English
setOptionHidden
About 177 wordsLess than 1 minute
2025-09-22
Dynamically set an option in a single-select or multi-select field of an object to hidden or visible.
Parameters
Description of param Properties
| Property | Description | Type | Default | Allowed Values |
|---|---|---|---|---|
| objApiName | Object apiName | String | — | — |
| dataIndex | dataIndex of one or more child object rows | String|Array | — | — |
| fieldName | Field apiName | String | — | — |
| optApiName | One or more option apiNames | String|Array | — | — |
| status | Whether to update to hidden state | Boolean | true | true: hiddenfalse: visible |
Return Value
None
Code Example
{
event: "form.render.end",
functional: function (pluginExecResult, options) {
console.log("custom plugin: form.render.end exec");
let {dataUpdater}=options;
// Hide an option of a main object field
dataUpdater.setOptionHidden({
fieldName: 'field_xx__c',
optApiName: ["option1"]
})
// Show an option of a main object field
dataUpdater.setOptionHidden({
fieldName: 'field_xx__c',
optApiName: ["option1"],
status: false
})
// Hide an option of a field for all rows of a specified child object
dataUpdater.setOptionHidden({
objApiName: 'SalesOrderProductObj',
dataIndex: 'all',
fieldName: 'field_xx__c',
optApiName: ["option1"]
})
// Hide an option of a field for specified rows of a specified child object
dataUpdater.setOptionHidden({
objApiName: 'SalesOrderProductObj',
dataIndex: ['1', '2'],
fieldName: 'field_xx__c',
optApiName: ["option1"]
})
}
},