You need to sign in to do that
Don't have an account?
Filter the trigger on child object based on the record type type on parent object
Hi all,
404/5000
I have two objects:
Object1__c (parent)
Object2__c (child)
Relationship master details.
For the parent object I have two types of records A, B
For the child object 2 types of records 1, 2 then if the parent object is of type A, the layout for the child will only appear 1 and if the parent object is B, the child layout will be only 2.
Someone has some trigger code to be able to do this verification.
Thanks!
I actually realized that the trigger was not answering me, so I did the following:
I created a custom button that calls the VFP.
I created a VFP that stores the data of the current record (parent record);
I created a class that creates the child record based on the parent's criteria, then redirects to the created record (child) in edit mode
All Answers
Please find the sample code below and tweak it as per your requirement. Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
Hi Nagendra,
Thank you for your help,
My code looks like this.
Objects:
- Contest_test__c is the parent object
- Test_data_data__c is the child object (List)
Code:
However, I'm getting the following error when trying to save :
I actually realized that the trigger was not answering me, so I did the following:
I created a custom button that calls the VFP.
I created a VFP that stores the data of the current record (parent record);
I created a class that creates the child record based on the parent's criteria, then redirects to the created record (child) in edit mode