Skip to main content



ToJson Function

Returns the JSON for an Entity or Entity Field.

Syntax 1​

ToJson()

Returns the JSON for an Entity or Entity Field.

Syntax 2​

ToJson(field)

Returns the JSON for an Entity or Entity Field.

Arguments​

field Field - An Entity Field or Entity in the current context hierarchy.

Remarks​

  • If the Entity is bound to state that does not support the ToJson method, a runtime error is thrown.

Example:

ToJson() // returns {"EntityField1": {PrimitiveField1 : 123}}

Example:

ToJson(Entity1) // returns {"EntityField1": {PrimitiveField1 : 123}}

Example:

ToJson(EntityField1) // returns {"PrimitiveField1" : 123}