Codeunit CCS DIS Json Helper
codeunit 5100901 "CCS DIS Json Helper"
Methods
GetBooleanValue
public "CCS DIS Json Helper" GetBooleanValue(Object: JsonObject; ValueKey: Text): Boolean
Returns the boolean value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Boolean
The value to be returned.
GetBooleanValue
public "CCS DIS Json Helper" GetBooleanValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Boolean
Returns the boolean value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Boolean
The value to be returned.
GetBooleanValueByPath
public "CCS DIS Json Helper" GetBooleanValueByPath(Object: JsonObject; ValuePath: Text): Boolean
Returns the boolean value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Boolean
The value to be returned.
GetBooleanValueByPath
public "CCS DIS Json Helper" GetBooleanValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Boolean
Returns the boolean value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Boolean
The value to be returned.
GetDateTimeValue
public "CCS DIS Json Helper" GetDateTimeValue(Object: JsonObject; ValueKey: Text): DateTime
Returns the datetime value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
DateTime
The value to be returned.
GetDateTimeValue
public "CCS DIS Json Helper" GetDateTimeValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): DateTime
Returns the datetime value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
DateTime
The value to be returned.
GetDateTimeValueByPath
public "CCS DIS Json Helper" GetDateTimeValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): DateTime
Returns the datetime value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
DateTime
The value to be returned.
GetDateTimeValueByPath
public "CCS DIS Json Helper" GetDateTimeValueByPath(Object: JsonObject; ValuePath: Text): DateTime
Returns the datetime value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
DateTime
The value to be returned.
GetDateValue
public "CCS DIS Json Helper" GetDateValue(Object: JsonObject; ValueKey: Text): Date
Returns the date value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Date
The value to be returned.
GetDateValue
public "CCS DIS Json Helper" GetDateValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Date
Returns the date value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Date
The value to be returned.
GetDateValueByPath
public "CCS DIS Json Helper" GetDateValueByPath(Object: JsonObject; ValuePath: Text): Date
Returns the date value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Date
The value to be returned.
GetDateValueByPath
public "CCS DIS Json Helper" GetDateValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Date
Returns the date value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Date
The value to be returned.
GetDecimalValue
public "CCS DIS Json Helper" GetDecimalValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Decimal
Returns the decimal value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Decimal
The value to be returned.
GetDecimalValue
public "CCS DIS Json Helper" GetDecimalValue(Object: JsonObject; ValueKey: Text): Decimal
Returns the decimal value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Decimal
The value to be returned.
GetDecimalValueByPath
public "CCS DIS Json Helper" GetDecimalValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Decimal
Returns the decimal value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Decimal
The value to be returned.
GetDecimalValueByPath
public "CCS DIS Json Helper" GetDecimalValueByPath(Object: JsonObject; ValuePath: Text): Decimal
Returns the decimal value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Decimal
The value to be returned.
GetGuidValue
public "CCS DIS Json Helper" GetGuidValue(Object: JsonObject; ValueKey: Text): Guid
Returns the guid value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Guid
The value to be returned.
GetGuidValue
public "CCS DIS Json Helper" GetGuidValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Guid
Returns the guid value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Guid
The value to be returned.
GetGuidValueByPath
public "CCS DIS Json Helper" GetGuidValueByPath(Object: JsonObject; ValuePath: Text): Guid
Returns the guid value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Guid
The value to be returned.
GetGuidValueByPath
public "CCS DIS Json Helper" GetGuidValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Guid
Returns the guid value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Guid
The value to be returned.
GetIntegerValue
public "CCS DIS Json Helper" GetIntegerValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Integer
Returns the integer value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Integer
The value to be returned.
GetIntegerValue
public "CCS DIS Json Helper" GetIntegerValue(Object: JsonObject; ValueKey: Text): Integer
Returns the integer value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Integer
The value to be returned.
GetIntegerValueByPath
public "CCS DIS Json Helper" GetIntegerValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Integer
Returns the integer value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Integer
The value to be returned.
GetIntegerValueByPath
public "CCS DIS Json Helper" GetIntegerValueByPath(Object: JsonObject; ValuePath: Text): Integer
Returns the integer value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Integer
The value to be returned.
GetTextValue
public "CCS DIS Json Helper" GetTextValue(Object: JsonObject; ValueKey: Text): Text
Returns the textual value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
Return Value
Text
The value to be returned.
GetTextValue
public "CCS DIS Json Helper" GetTextValue(Object: JsonObject; ValueKey: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Text
Returns the textual value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Text
The value to be returned.
GetTextValueByPath
public "CCS DIS Json Helper" GetTextValueByPath(Object: JsonObject; ValuePath: Text): Text
Returns the textual value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
Return Value
Text
The value to be returned.
GetTextValueByPath
public "CCS DIS Json Helper" GetTextValueByPath(Object: JsonObject; ValuePath: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean): Text
Returns the textual value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Return Value
Text
The value to be returned.
GetValue
public "CCS DIS Json Helper" GetValue(Object: JsonObject; ValueKey: Text; DataType: Text; var Value: Variant): None
Returns the value of a property from an object.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
DataType | Text |
The data type to convert the value to. |
Value | Variant |
The value to be returned. |
Return Value
None
GetValue
public "CCS DIS Json Helper" GetValue(Object: JsonObject; ValueKey: Text; DataType: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean; var Value: Variant): None
Returns the value of a property from an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValueKey | Text |
The property key. |
DataType | Text |
The data type to convert the value to. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Value | Variant |
The value to be returned. |
Return Value
None
GetValueByPath
public "CCS DIS Json Helper" GetValueByPath(Object: JsonObject; ValuePath: Text; DataType: Text; var Value: Variant): None
Returns the value of a property from an object, by path.
Throws an error if the property does not exist.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
DataType | Text |
The data type to convert the value to. |
Value | Variant |
The value to be returned. |
Return Value
None
GetValueByPath
public "CCS DIS Json Helper" GetValueByPath(Object: JsonObject; ValuePath: Text; DataType: Text; ErrorIfNotExisting: Boolean; ErrorIfNull: Boolean; ErrorIfUndefined: Boolean; var Value: Variant): None
Returns the value of a property from an object, by path.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to get the property from. |
ValuePath | Text |
The property path. |
DataType | Text |
The data type to convert the value to. |
ErrorIfNotExisting | Boolean |
Throw an error if property was not found. |
ErrorIfNull | Boolean |
Throw an error of the value is NULL. |
ErrorIfUndefined | Boolean |
Throw an error if the value is UNDEFINED. |
Value | Variant |
The value to be returned. |
Return Value
None
GuidToText
public "CCS DIS Json Helper" GuidToText(Value: Guid): Text
Formats an AL GUID into text, without the {}.
Parameters
Name | Type | Description |
---|---|---|
Value | Guid |
The GUID. |
Return Value
Text
The formatted GUID.
RecordToJson
public "CCS DIS Json Helper" RecordToJson(RecRelatedVariant: Variant): JsonObject
Converts a record (or recordref) into a json object.
Fields are added as properties by name.
Parameters
Name | Type | Description |
---|---|---|
RecRelatedVariant | Variant |
The record or recordref. |
Return Value
JsonObject
The record as json object.
SetObjectValue
public "CCS DIS Json Helper" SetObjectValue(var Object: JsonObject; PropertyName: Text; PropertyValue: Variant): Boolean
Sets the variant value for a property of an object.
Throws an error if the property already exists.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to set the property for. |
PropertyName | Text |
The property key. |
PropertyValue | Variant |
The variant value. |
Return Value
Boolean
SetObjectValue
public "CCS DIS Json Helper" SetObjectValue(var Object: JsonObject; PropertyName: Text; PropertyValue: Variant; ThrowError: Boolean): None
Sets the variant value for a property of an object.
Parameters
Name | Type | Description |
---|---|---|
Object | JsonObject |
The object to set the property for. |
PropertyName | Text |
The property key. |
PropertyValue | Variant |
The variant value. |
ThrowError | Boolean |
Throw an error if the property exists or value could not be added. |
Return Value
None