English
addRelateDatas
About 110 wordsLess than 1 minute
2025-09-22
addRelateDatas(param)
Adds related-object data.
Parameters
Description of param properties
| Property | Description | Type | Required |
|---|---|---|---|
| objApiName | Related object apiName | String | Yes |
| relatedFieldName | Related field apiName | String | Yes |
| recordType | Business type | String | Yes |
| dataList | Data list to add | Array | Yes |
Return Value
Returns the added related-object data list.
Code Example
export default class Plugin {
apply() {
return [{
event: 'form.render.after',
functional: this.formRenderAfter.bind(this)
}]
}
formRenderAfter(context, plugin) {
const list = context.dataUpdater.addRelateDatas({
objApiName: 'AccountObj',
recordType: 'default__c',
relatedFieldName: 'product_id',
dataList: [{
name: 'test',
sex: 'nan'
}]
});
console.log(list)
}
}Notes
- If required parameters are missing, no action will be executed.
- The added data will automatically be supplemented with
record_typeandrowId.
