English
setFieldError
About 182 wordsLess than 1 minute
2025-09-22
Dynamically set the red error message displayed below a field of an object. Once set, it will block the submission process.

Parameters
Description of param Properties
| Property | Description | Type |
|---|---|---|
| objApiName | Object apiName | String |
| dataIndex | dataIndex of one or more child object rows | String|Array |
| fieldName | One or more field apiNames | String|Array |
| status | Error message text; empty means clear the error message | String |
Return Value
None
Code Example
{
event: "form.render.end",
functional: function (pluginExecResult, options) {
console.log("custom plugin: form.render.end exec");
let {dataUpdater}=options;
// Set error message for a main object field
dataUpdater.setFieldError({
fieldName: 'field_xx__c',
status: "Field error message from plugin"
})
// Clear error message for a main object field
dataUpdater.setFieldError({
fieldName: 'field_xx__c',
status: ""
})
// Set error message for certain fields of specified rows in a child object
dataUpdater.setFieldError({
objApiName: 'SalesOrderProductObj',
dataIndex: ['1', '2'],
fieldName: ['field_xx__c'],
status: "Field error message from plugin"
})
// Clear error message for certain fields of specified rows in a child object
dataUpdater.setFieldError({
objApiName: 'SalesOrderProductObj',
dataIndex: ['1', '2'],
fieldName: ['field_xx__c'],
status: ""
})
}
},