English
setHidden
About 205 wordsLess than 1 minute
2025-09-22
Dynamically set a 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 | One or more field apiNames | String|Array | — | — |
| status | Whether to update to hidden state | Boolean | true | true: hiddenfalse: visible |
| priority | Priority. The larger the number, the higher the priority. Values greater than 10 will override the layout state | Number | 0 | — |
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 one field of the main object
dataUpdater.setHidden({
fieldName: 'field_xx__c'
})
// Hide multiple fields of the main object
dataUpdater.setHidden({
fieldName: ['field_xx1__c', 'field_xx2__c']
})
// Show some fields of the main object
dataUpdater.setHidden({
fieldName: ['field_xx__c'],
status: false
})
// Hide certain fields for all rows of a specified child object
dataUpdater.setHidden({
objApiName: 'SalesOrderProductObj',
dataIndex: 'all',
fieldName: ['field_xx__c'],
})
// Hide certain fields for specified rows of a specified child object
dataUpdater.setHidden({
objApiName: 'SalesOrderProductObj',
dataIndex: ['1', '2'],
fieldName: ['field_xx__c']
})
}
},Notes
- Default rule: layout-required fields cannot be set to hidden. To skip this rule, configure
isSkipLayoutFieldStateCheckastruein theform.render.beforeevent.
