Sunday, April 23, 2023

Salesforce: Dynamic form by Record Type

Background: Universal Container uses many record types in the Case object, one of the new requests is fit to use the dynamic form feature, but does not want to impact all existing record types which still use page layout.

Solution: create a new lightning record page (or clone from the existing one) and assign it to:

  •  A specific app
  • The new record type
  • All profiles that will use the new lightning record page 


Saturday, April 22, 2023

Salesforce: Query all Objects

As admin/developer, you can easily see all objects available in an org., but sometimes we need to get the list of the objects. Of course you can manually copy and paste from the Object Manager, but that is not ideal. 

Salesforce provide ability query using Tooling API from version 32.0 and later. EntityDefinition provides row-based access to metadata about standard and custom objects.

Sample query: 

SELECT QualifiedApiName, Label, ExternalSharingModel, InternalSharingModel, DurableId, DeploymentStatus, NamespacePrefix, Description, LastModifiedDate, LastModifiedById FROM EntityDefinition ORDER BY QualifiedApiName 

Compare from the Object Manager UI, using query, you also can also get the object sharing model, last modified by, DurableId. In this query, DurableId is the object Id, if you open a custom object from object manager, e.g., the one in bold is DurableId. While for standard object such as Account, the DurableId is Account, e.g.

01I prefix is for CustomEntityDefinition


Page-level ad