function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ForceDev54ForceDev54 

Fields based on the selected record type for the custom object

Hi,

Consider, I have a following scenario,

 

Object A has 3 fields named Field 1, Field 2, Field 3 and 2 record types named rct1 and rct2.

In rct1, I have Field 1 and Field 2. (hiding Field 3) and assign it to the page layout 1.
In rct2, I have Field 2 and Field 3. (hiding Field 1) and assign it to the page layout 2.

 

I am not using any field level security and I cannot change the existing one.
I am creating a template for the data load.

 

If I select rct1 from select list, I want to only show Field 1 and Field 2 in the template.
If I select rct2 from select list, I want to only show Field 2 and Field 3 in the template.

 

How do I get the fields from the fielddescriberesult based on the selected record type?

 

Thanks in advance

hitesh90hitesh90

Hi,

 

Follow the below two steps to fulfill your requirement.

 

1. Create two New Page Layout. 1 for rct1 and second for rct2.

2. assign recordtype rct1 and rct2 to particular pagelayout.

 

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
My Blog:- http://mrjavascript.blogspot.in/

ForceDev54ForceDev54

Hi hitesh,

 

Thanks for your reply. I am not taking about the ui and I am talking about apex.

 

As i said, I am creating a template for the data load.

 

My requirement is before i creating a template, i need to select the record type available to the custom objects and i need only to show the fields available to selected record type in the template.

 

I hope it is clear.

 

Thanks =