Posts

Showing posts with the label Name

Salesforce Fact #883 | Careful while accessing getObjectInfo to get record type details

Image
We need to be careful while using getObjectInfo module to access the record types in LWC. We can access the record type name property and there is no developer name property present. The name returns the label of the record type and if translation is present for the user language then the translated value is returned. So, we need to be careful while doing any check to match the record type name. There is an Idea already submitted to add the Developername in the data returned:  https://ideas.salesforce.com/s/idea/a0B8W00000H50x7UAB/include-developername-in-the-recordtypeinfo-returned-with-getobjectinfo-in-lwc 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 #708 | Name compound field in lightning-input-field

Image
For Sobjects where the Name field is a compound field and consists of FirstName, LastName, MiddleName, Suffix and Salutation, we can specify the Name field directly in lightning-input-field. This will show the FirstName, LastName and Salutation fields as input. Reference:  https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/documentation Attached is the screenshot.