Posts

Showing posts with the label fields

Salesforce Fact #887 | fields empty on LWC getRecords

Image
If the fields parameter in LWC getRecords is an empty array, then it returns no data neither it returns any error. It just skips the execution of the getRecords. Note: This is just a POC and ideally the fields array won't be empty. Attached are the screenshots.

Salesforce Fact #715 | Dynamic name fields using reactive screen components

Image
Another use case related to reactive screen components. Suppose, we have a screen flow where we are using the Name input type to capture user's name. Now, the name can consist of FirstName, LastName, MiddleName, informalname. Considering FirstName and LastName would always be provided we can dynamically specify the remaining fields to be captured using reactive feature. In this example, we have two checkboxes: one confirming the user has a middle name and one confirming the user has an informal name. Based on the selection made, the fields are formed dynamically and are rendered the same in the UI. Attached are the screenshots.

Salesforce Fact #676 | Get readonly fields in page layout using apex

Image
Using Metadata class methods, we can get the list of fields present in a particular page layout. Suppose we need to find out the list of ReadOnly fields in a page layout, we can get the same using a condition check on  Metadata.UiBehavior enum. It has three values: ' Edit ', ' ReadOnly ' & ' Required '. Reference:  https://salesforce.stackexchange.com/questions/179442/apex-metadata-api-layout-read-only-fields-being-added-as-read-write Attached is the screenshot.