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
AbAb 

Custom button | clicking on a custom button on parent object will redirect to new record creation of child object with prepopulated record type

Hello,

#I have two objects.
> Standard object (contact) (Master)
> Custom object (cust__c) (Detail)
They both have master detail relationship

#Both of them have Two record types each
> contact has record type "Con1" and "con2"
> cust__c has record type "Cus1" and "Cus2"

#Other info
> the detail page layout is present on the parent object

#Requirement
> I want to make sure that if a new "cust__c" is created on contact with record type "Con1" then mandatorily it should be associated to "Cus1".
> Similaryly, "Con2" should be associated to "Cus2", 
> Both of the association should be mandatory for a user

#Solution required
I am looking for solution where clicking on a custom button on parent object will redirect to new record creation on of child object with prepopulated record type

Thank you for suggestion
Best Answer chosen by Ab
Andy BoettcherAndy Boettcher
A custom button is not your solution - use Publisher Actions.  You can set default field values with a Publisher Action without hacking things together or doing unsupported things like URL hacks.