You need to sign in to do that
Don't have an account?
Deepu Gupta 29
Now the issue is for this custom object.Because its parent is child opp and i want to update that checkbox on its parent opportunity.
for ex.
Result : Custom object -> Child Opp -> Parent Opp
and i want to update the checkbox true whenever Result custom object checkbox is true.
Any suggestion?
Parent opportunity Checkbox needs to be true
Hi All, I have Req where i need to update Parent Object(Opportunity) Checkbox when the child object(custom object) checkbox is true.There is lookup relationship between both the objects. I have achive this via below code : trigger RRRequired on ESA_Result__c (after insert, after update) { list<Opportunity> listofParentObjToUpdate; set<Id> setOfids = new set<Id>(); for(ESA_Result__c childobj :trigger.new){ if(childobj.ESA_R_R_Required_EI__c==true){ setOfids.add(childobj.ParentOpportunity_EI__c);// you child object must having parent object field, put that field Api Name here } } if(!setOfids.isEmpty()) { list<opportunity> listOfParentObj = [select id,ESA_R_R_Required_EI__c from opportunity where Id =: setOfids]; listofParentObjToUpdate = new list<opportunity>(); for(opportunity parent : listOfParentObj) { parent.ESA_R_R_Required_EI__c = true; listofParentObjToUpdate.add(parent); } } Update listofParentObjToUpdate; }
Now the issue is for this custom object.Because its parent is child opp and i want to update that checkbox on its parent opportunity.
for ex.
Result : Custom object -> Child Opp -> Parent Opp
and i want to update the checkbox true whenever Result custom object checkbox is true.
Any suggestion?
Would you like to update opportunity to True when a relative child record ESA_R_R_Required_EI__c equals True or If its false then update relative parent record opportunity to False right ?
Also, Instead of after insert and update you can make use of before event to avoid recursive
Here is a Trigger which I have tested with several possiable scenarios.
Parent Object : Contact
Field : Checked_Checkbox_Exists__c
Child Object : Credit__c
Field : Check_box__c
Requirement : Whenever there is a child record for parent with Check_box__c = TRUE then update Checked_Checkbox_Exists__c = TRUE on Parent Object as well.
Trigger Code:
Hope this helps!
This is the message I am getting - "The operation is not permitted. If you received this in error, please contact info@developerforce.com (code: B2)"
She would like to update the check box on parent opportunity on child opp that relates to multiple child records. So we need the API name of parent opp on child opp
Not Recieved the code.can you try via attachment?
Is there a self lookup from opp to opp ?
Let me know the email address and I will try to send it.
id is deepikagupta0611@gmail.com.