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
kirubakaran viswanathankirubakaran viswanathan 

How to override the standard Recordtype selection panel in lightning?

I need to override the list of recordtypes displaying in the selection panel when the user clicks the "New" button.
Ex: I have recordtype A, B, C in Opportunity, whenever the user clicks "New" the selection window need to display only A and B. But he should have access to C recordtype. Because I have another quick action button in the detail page to create records with C recordtype for the user. 
Is that possible to override the selection window to display specific record type?
Prashant Yadav 90Prashant Yadav 90
Hi, what you could do is assign A and B recordtypes at profile and uncheck recordtype C. this should work

Cheers!
Prashant
kirubakaran viswanathankirubakaran viswanathan
Hi Prashat,
if I remove from the profile, he can’t create that C record type from detail page of A/B record type records. The user has to have access to all record type, but C should be created from detail page (custom button) . A and B should be created from “New” button. 
Prashant Yadav 90Prashant Yadav 90
you could give the user additional access to recordtype C using permission set, i think this shoud solve visiblity issue on "New" button
kirubakaran viswanathankirubakaran viswanathan
Hi Prashant,

Both Profiles and Permission set are the same base level access. So, it will not work. I have tested that. 
 
Prashant Yadav 90Prashant Yadav 90
Hi Kirubakaran, Ok gotcha, I am not sure if this approach will work for you but if the underlaying opportunity stage has common values then change recordtype after a particular stage is reached? So give profile access on opportunity object to viewall so that user can see Recordtype C as well. If recordtype A,B and C has common process till certain stage let’s say first 3 stages are common after which process changes for RecordType C, on pagelayout of A and B create a custom field which is also common to C, example Product Picklist unique to C, User choose a value from the picklist and saves the record on stage 3, then process builder will fire and changes recordtype from either A or B to C. Since it is process builder which is changing the recordtype setting and user has view all access he can continue to work on RecordType C. Set visibility of Field level security on this custom field for this profile. I use the above approach in my organization and it is working fine with no user compliants. Let me know your thoughts on this approach. Kind Regards Prashant
kirubakaran viswanathankirubakaran viswanathan
Hi Prashant,

Actually, your workaround will work. But my business scenario is simple. Here recordtype C is the addendum opportunity, which will be created whenever it is needed. It is not always needed. So the user needs access to create, but they have to create only from parent opportunity. Therefore, this recordtype should not display in the "New" button.