Sets the field definition for an attribute field of a document feature layer. You cannot update an existing field's field TYPE or modify a web feature layer field definition.
Syntax
(esri_fielddef_set flname field_properties)
Arguments
- flname | string | required | An existing feature layer name in the drawing.
- field_properties| associated list | required | Associated list of feature layer field properties as dotted pairs.
Associated label Value type Value description Required or optional "NAME" string
Field name.
Required
"LENGTH" integer
Field length for text fields (ONLY).
Optional (set to UI defaults)
"VALUE" variant
Default field value.
Optional (set to UI defaults)
Example usage
Attempt to update the definition of the Location field of the Parks feature layer.(esri_fielddef_set "Parks"
(list
(cons "NAME" "Location")
(cons "LENGTH" 254)
(cons "VALUE" "CA")
))
Result example usage
Updates the definition of the Location field of the Parks feature layer, returns a list of true:
(T)
Return values
The following are the possible return values:
- If successful, the function returns a list of true: (T)
- If failed, it returns a list with the first value of nil and then an associated list containing the key value "Error" and an associated error message as a string: (nil ( "Error" . "<message>")).
Failed return values
Failed return values can occur for any of the following reasons:
- (nil ("Error" . "Field is not editable"))
You cannot update an existing field's field TYPE or modify a web feature layer field definition.
- (nil ("Error" . "Input string was not in a correct format."))
The specified value was of the wrong type.
- (nil ("Error" . "Feature layer not
found."))
The specified feature layer value is not a valid feature layer in the drawing.
- (nil ("Error" . "No edits made"))
No edits were made as there was a problem with the routine as written.