Get the Layout Corresponding To a Specific RecordType/Profile Combination – Flow Action

Layouts often differ substantially from recordType to recordType and from profile to profile. This action takes a recordTypeId and a profileId and returns that combination’s current LayoutId. One use of this is dynamically generating flow screen layouts with the RecordDetail flow screen component. To do this, after using this action to retrieve a LayoutId, use the GetLayoutFields action to retrieve the list fo field names from that layout. You can then pass the list of field names to RecordDetail to generate a customized record detail right in your Flow screen that maps to the layout. To see this in action, check out this video.

Inputs

AttributeTypeDescription
recordTypeIdStringThe ID of a recordType
profileIdStringThe ID of a profile. Note that you can quickly generate this in Flow by creating a formula of $User.profileId

Outputs

AttributeTypeDescription
layoutIdString

Installation

Install this action as part of the QuickChoice managed package or just grab the source.

0 0 vote
Article Rating
Subscribe
Notify of
guest
3 Comments
Inline Feedbacks
View all comments
Arvind
Arvind
4 months ago

I am getting an error from this component when Profile Id and RecordTypeId is passed to the Apex Action: Error Occurred: An Apex error occurred: System.TypeException: Invalid conversion from runtime type List to Map

trackback

[…] Get Layout Info by Record Type and Profile […]

David Rabizadeh
David Rabizadeh
4 months ago

I am getting this error only when running the flow from a record. I do not get this error when debugging.
Error Occurred: An Apex error occurred: System.TypeException: Invalid conversion from runtime type List to Map