English
updateDetailDataByApiName
About 171 wordsLess than 1 minute
2025-09-22
This method synchronously overwrites and updates all data of a specific child object. Deletion, addition, and update are all supported. It does not trigger calculation or UI events.
Parameters
| Parameter | Description | Type |
|---|---|---|
| apiName | Object apiName | String |
| list | All data of the object. The record_type field is required in the data. | Array |
Return Value
None
Code Example
export default function (context) {
return {
/** After the create/edit page has finished rendering */
renderEnd(){
// Example of overwriting and updating child object data
let datas = context.getDetailData("object_slavetest__c");// get current data
if(datas&&datas[0]){// if child object object_slavetest__c currently has data, update the main property of the first row
datas[0].name="Main Property Generated by Plugin"
}else{// if child object object_slavetest__c currently has no data, add one row with record type default__c
datas = [
{
record_type:"default__c",
name:"Main Property Generated by Plugin"
}
]
}
context.updateDetailDataByApiName("object_slavetest__c", datas);
}
}
}Notes
- Avoid calling
context.updateDetailDataByApiNamefrequently. Frequent calls that trigger UI updates will affect performance and may cause page lag.
