0

how to hide a record type option from the "new record" pop up?

I have a custom object A from where if I click New Case in related list, user should be able to create a case. User has been given access to 2 case record types. I do not want record type pop up screen to show up for record type selection. Based on a field let's say test A on object A , when new case is clicked it should decide which case record type to create based on the values of test a field. If test A field on object is Mango then create Test1 case record type record Else create Test2 Case record type.

So my question is, how can I hide these other record types from the pop up without restricting the users access to all record types?

2/4/2024- Here is the formula I used but I still do not see insurance policy record staying open.

/lightning/o/Case/new?recordTypeId=recordtypeID&defaultFieldValues=
Insurance_Policy__c={!InsurancePolicy.Id}
&backgroundContext=/lightning/r/InsurancePolicy/{!InsurancePolicy.Id}/view
8
  • 1
    are you willing to override the New button?
    – cropredy
    Commented Jan 28 at 19:14
  • @cropredy Yes if that is the only way.
    – Coder
    Commented Jan 29 at 20:41
  • Remove the New button from the related list and replace with a "new" New Case V2 button that is a URL; then use Lightning URL hack to define the recordTypeId to use - which can leverage SFDC formulas for conditional logic. Make the New Case V2 visible in the related list. Work with this a bit and if you get stuck, use edit to show what you've tried and where you are stuck
    – cropredy
    Commented Jan 30 at 4:55
  • @cropredy - I created the list button and added to the parent object. When I click the button I able to open new case record with record type id I passed and also lookup field is populated with value but it closes the original parent object record. this is the formula I used- /lightning/o/Case/new?recordTypeId=0123txxxxxxxx&defaultFieldValues= Insurance_Policy__c={!InsurancePolicy.Id} ...how can I keep the insurance policy obejct record opened as is. It closes the window of insurance policy and just keep window of new case created.
    – Coder
    Commented Jan 31 at 21:50
  • In Classic, you would use &retURL but in Lightning, you use &backgroundContext=/lightning/r/Insurance_Policy__c/{!Insurance_Policy__c.Id}/view. AS I said earlier, please use edit instead of comments to show the current state of your issue - it is so much easier for community users to help
    – cropredy
    Commented Feb 1 at 0:42

1 Answer 1

0

Formula that worked - /lightning/o/Case/new?recordTypeId={!$Setup.CaseRecordTypeIDs__c.DefferedDomain__c} &defaultFieldValues=Insurance_Policy__c={!InsurancePolicy.Id}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .