ftos.xml.serialize
IMPORTANT!
Starting with v24.3, this is renamed from serialize to ftos.xml.serialize.
Starting with v24.3, this is renamed from serialize to ftos.xml.serialize.
Serializes an object to a JSON string.
This is a business logic method for business service components.
Syntax
ftos.xml.serialize(object: any): string
| Parameter | Description |
|---|---|
object
|
Object you wish to serialize in JSON format. |
Return Value
Returns a JSON string describing the object.
Examples
In this example:
- We store the contents of the e399b07f-29f6-4147-ad52-8e49acc07992 record in the account entity in an object called obj (for details, see ftos.data.getById).
- We serialize the object's contents in a string called message.
- We display the message on screen. For details on how to display messages, see ftos.context.response.setMessage.
var obj = ftos.data.getById('account','e399b07f-29f6-4147-ad52-8e49acc07992');
message = ftos.xml.serialize(obj);
ftos.context.response.setMessage(message);