You need to sign in to do that
Don't have an account?
imma
Create a workflow to update a Master-Detail Relationship field
hello all
I have tow objects Campaign and Prospect ( campaign is the master and prospect the detail)
and I want to create a work flow rule to update a Master-Detail Relationship field " Campaing " in the object prospect ( if the name of prospect = "aaa" then affect the prospect to the campaign with the name : "campaignaaaa"
when I try to create a work flow rule to update a Master-Detail Relationship field " Campaing " , the field Campaing doesn't appear in the section : " Field to Update" !!! is this beacause "Campaing" is Master-Detail Relationship field ????
What can I do ? and why the master detail relationship is a required field ???
I have tow objects Campaign and Prospect ( campaign is the master and prospect the detail)
and I want to create a work flow rule to update a Master-Detail Relationship field " Campaing " in the object prospect ( if the name of prospect = "aaa" then affect the prospect to the campaign with the name : "campaignaaaa"
when I try to create a work flow rule to update a Master-Detail Relationship field " Campaing " , the field Campaing doesn't appear in the section : " Field to Update" !!! is this beacause "Campaing" is Master-Detail Relationship field ????
What can I do ? and why the master detail relationship is a required field ???
We cannot update either master detail or lookup relationship field using workflow rule. You will have to use trigger approach instead.
Because I don't have any exprience with trigger so I have to think about an existing solution
https://www.youtube.com/watch?v=XgjlPWaElRc
Yes, master detail is always a required field.
Process builder will also not work since we will have to perform SOQL to fetch the Campaign record where Name = 'Campaignaaaa' and then populate the respective Id to master detail field.
Please let us know if you need any assistance for the creation of trigger.
Greetings!
First of all, Master-Details field is mandatory. So you can not leave it as a null.
And if you want to update the parent object, Please use Apex triggers, which will help you to update the parent object.
Because in a trigger you can perform SOQL query and fetch the information of the record up to three-level.
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi