In the latest release Salesforce finally let us to migrate fields and sections from page layout to any place on the record page as individual components. This of course means, that you can set visibility of those fields and sections individually. Unfortunately it all works on Custom Objects only… Or not? Though Dynamic Forms really work just on Custom Objects, I will show you easy workaround for Standard Objects . In the tutorial we will display Shipping Address on Account in the right region aside from the rest of the record. To accomplish this we will use Lightning App Builder to create new Record Page for Contact object and quick action to create custom section layout . For this interesting idea I would like to thank my colleague Emma Peeters , who introduced the workaround on my recent project. Update Account page layout First we will remove the Shipping Address Section from Page Layout on Account Object . Go to Object Manager → Account → Page Layouts → Account L
I’ve had a pleasure to watch many Salesforce technical architects trying to find a perfect way, how to work with Record Types in Apex . One created class Global_Constants to store all Record Type Ids and DeveloperNames in static properties, the other queried RecordType table and put the result in the map. I was never impressed so I‘ve come up with Record Type Provider , that allows you to access RecordTypeId like this: RecordTypeProvider.[ObjectName].[RecordTypeName].Id . It’s not perfect, but it definitely has its pros. What doesn’t work First, I would like to stop by the usual solutions and explain, why they do not work (well). Querying the RecordType table is extremely fast – you get all the Record Type descriptions in few miliseconds, but on the other hand you lose what every Salesforce developer must treasure the most – SOQL query . You may think, that you have only limited amount of classes and this one tiny query will never mean anything, but over time logic in your o