English
insert(apiName, dataIndex, object_datas)
About 176 wordsLess than 1 minute
2025-11-24
Insert child object data before the data row at the specified index.
Parameters
| Parameter | Description | Type |
|---|---|---|
| apiName | Child object apiName | String |
| dataIndex | dataIndex of the target child object data | String |
| object_datas | One or more standard child object data records (object_data) | Object|Array |
Required Properties of object_data
If the following properties are missing, the add operation will fail.
| Property | Description | Type |
|---|---|---|
| object_describe_api_name | Object apiName | String |
| record_type | Record type | String |
Return Value
object_datas: the successfully added data. If the original data does not contain dataIndex, the returned data will include a supplemented dataIndex.
Code Example
{
event: "form.render.end",
functional: function (pluginExecResult, options) {
console.log("custom plugin: form.render.end exec");
let {dataUpdater}=options;
// Add one row of data
dataUpdater.add({object_describe_api_name:"SalesOrderProductObj",record_type:"default__c",name:"1",dataIndex:'0'});
// Insert one row of data before the row whose dataIndex is '0'
dataUpdater.insert("SalesOrderProductObj",'0',[{object_describe_api_name:"SalesOrderProductObj",record_type:"default__c", name:"2",dataIndex:'1'}]);
}
},Notes
- This method only contains logic for adding child object data. It does not trigger calculations or UI events.
