EsriEduNL / veldwerk2.0

WebApp to use ArcGIS Online Organization account for student field trips
GNU General Public License v2.0
1 stars 0 forks source link

Error 1000 #36

Closed dhunink closed 9 years ago

dhunink commented 9 years ago

Following code returns Error code 1000: String or binary data would be truncated. The statement has been terminated. The POST parameters are included below.

var features = fsRequestQueryResult.features;
features.forEach( function (feature)
{
    delete feature.attributes.OBJECTID;
    delete feature.attributes.GlobalID;
    feature.attributes.GROUPID = groupid;
});

fsAddUrl = vragenLayerURL+"/addFeatures";
var fsRequestAddFeatures = esriRequest({
    url: fsAddUrl,
    content: { f: "json", features: JSON.stringify(features)},
    handleAs: "json"
}, { usePost: true });
    return fsRequestAddFeatures;
features    [{"attributes":{"GROUPID":"65939e812cb140bd96ea35179396d5c9","DOCENTID":null,"TITLE":"Gebouw","QUESTION":"Als je met je rug naar het station staat zie je een grijs kantoorgebouw. Op de benedenverdieping zitten ook enkele winkels. Wat is de naam van dit gebouw?","ANSWER":"Ik kan alleen maar GIS'sen naar het antwoord...","SCORE":null,"CreationDate":1423750097014,"Creator":"","EditDate":1423769741519,"Editor":""},"geometry":{"x":497514.26132130495,"y":6786211.315524658}}]
mvanhulzen commented 9 years ago

This errormessage is consistent with putting a value in a column that is to large for the column with. How many charachters is question and how many characters can you put in the question column?

dhunink commented 9 years ago

Edited the feature service to support up to 256 characters on those fields.

dhunink commented 9 years ago

The problem still exists, althoug all attributes are now way below the character limit of the fields. Featureservice details: http://services3.arcgis.com/oecFpSTGbkyJV2e0/arcgis/rest/services/Veldwerk_Template_kaartlaag/FeatureServer/1

Post parameters (left CreationDate and EditData empty on purpose, to rule those out as being to long for their fields): f json features [{"attributes":{"TITLE":"Gebouw","QUESTION":"Als je met je rug naar het station staat zie je een grijs kantoorgebouw. Op de benedenverdieping zitten ook enkele winkels. Wat is de naam van dit gebouw?","ANSWER":"Ik kan alleen maar GIS'sen naar het antwoord...","SCORE":null,"CreationDate":"","Creator":"","EditDate":"","Editor":"","GROUPID":"461a12c87d294c7a9b585162af63a352","DOCENTID":null},"geometry":{"x":497514.26132130495,"y":6786211.315524658}}]

response: {"addResults":[{"objectId":null,"globalId":"8EAA1E7E-ACD5-4B1F-A1AD-67F90E1C24BF","success":false,"error":{"code":1000,"description":"String or binary data would be truncated.\r\nThe statement has been terminated."}}]}

dhunink commented 9 years ago

Was fixed in the past commits and edits of the featurelayer