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
harry.kimharry.kim 

Can I get a selected record type before insert the new record?

Hello.
I made two record types.
When I select the first record type, I'd like to create a new record in a A page with some detail information and
If I select the second record type, I'd like to create a new record in a A page without detail information.
( A page is visualforce page or lightning component, not page layout) 
So, to make this process, I need to know the selected record type information.
Because, depends on the record type, I will hide some lightning component items.
But I have no idea about this.
is it possible??? please help me .
 
NagendraNagendra (Salesforce Developers) 
Hi Harry,

May I suggest you please refer to below link with a similar discussion which should help you further. Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
 
harry.kimharry.kim
I mean.. I just want to know about now selected record type (just when a user select a new button) not all record type list..User-added image
 
Raj VakatiRaj Vakati
What i understand from this description is depends on the record type, I will hide some lightning component items.


For that you no need to do any custom code .. 


Component visibility properties appear when you select a component on a record, app, or Home page in the Lightning App Builder. This behavior applies to standard components, custom components, and components from AppExchange. No need to do anything to your custom components. It’s all handled by the Lightning App Builder.


Refer this link 

https://help.salesforce.com/articleView?id=lightning_page_components_visibility.htm&type=5