Salesforce Fact #884 | LWC getRecord optionalFields in action

The LWC getRecord optionalFields parameter is pretty helpful to deal with fields which have been used in the getRecord but the current user does not have access to.

If we specify the same field in fields parameter, the call to getRecord fails with error, while if the same field is used in optionalFields it is ignored and the data is returned for the rest of the fields.

In this example, the current user does not have access to the Account Description field.

Reference: https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-record.html

Attached are the screenshots.







Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow