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
SFDC@ErrorSFDC@Error 

child record type open based parent field value

Hi All,
How can i open child record type page automatically on click of the new button of the child in details page based on parent field value?
I have two record type in the child object.but when i am creating child record from the parent, it should select the record type and create.I want to override this step based on the parent field. that auto-redirects the record type page, no need to select particular record type.
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Follow below steps:

1. You can create a new Button on child object as a "list button".
2. Give name and label for a button
3. Select Content Source: URL
4. In the formula window, 
/apex/name of page?RecordTypeID=value you want to set.

Create your custom button and add it on the page and remove the standard new button from page layout

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
SFDC@ErrorSFDC@Error
Okay Anas.But in lightning how can i create this?