insert
Adds a new record to an entity.
Syntax
function insert(entityName: string, values: any): string
| Parameter | Description |
|---|---|
entityName
|
Name of the entity where you wish to insert the record. |
values
|
Name – value pairs of the record's attributes in JSON format. |
Return Value
Returns a string containing the ID of the created record.
Examples
In this example:
- We create a new businessunit.
- The name and primaryattributedisplayname of the new business unit is Documentation.
- The parentBusinessUnitId is a3d2909b-df67-49d6-b7e0-2dc912c12484. This is the unique identifier of the root business unit in our setup.
insert('businessunit', {name: 'Documentation', primaryattributedisplayname:'Documentation', parentBusinessUnitId:'a3d2909b-df67-49d6-b7e0-2dc912c12484'});