Invoke Method: add field throws error for String field, works for Integer
I'm adding a field to a featureset using the Invoke Method. When the field is an integer it works fine. When the field is a string it doesn't work and throws the following, even though the TargetObject isn't null:
Unhandled exception: 'Value cannot be null.
Parameter name: TargetObject' in activity '1.278: InvokeMethod'.
Value cannot be null.
Parameter name: TargetObject
The field that works:
New ESRI.ArcGIS.Client.Field("LocationID", ESRI.ArcGIS.Client.Field.FieldType.Integer, "Location ID", Nothing, False, True, 10)
The field that doesn't work:
New ESRI.ArcGIS.Client.Field("FIELD", ESRI.ArcGIS.Client.Field.FieldType.String, "Location Description", Nothing, False, True, 100)
Any ideas?
0
-
Hi Mark
have you tried:
New ESRI.ArcGIS.Client.Field("myNewField", ESRI.ArcGIS.Client.Field.FieldType.String, "Location Description", Nothing, False, True, 100)
just in case there is something special about your field name.
Can you post a more complete snippet from your workflow for the forum to look at?
Thanks
Ralph Price0 -
Hi Ralph,
I've looked at this further and it seems to be a logic problem or something else going on. If I add a field to a FeatureSet, obtained from a Query Task, it works fine. However, in my workflow I need to combine a number of FS into one and I do this via a List to output a new FS. Trying to add a field to the new FS fails no matter what type of field it is.
Here's a simplified workflow snippet (.txt file):
ftp://spatial:d0cspat1al@ftp.doc.govt.nz/Spatial/Geocortex
Thanks,
Mark0 -
I'm having this same issue. Were you able to figure it out? 0 -
You first need to create a Field List, before declaring the Field.
ASSIGN: FeatureSet1.Fields = New List (Of Esri.ArcGIS.Client.Field)0
Please sign in to leave a comment.
Comments
4 comments