You need to sign in to do that
Don't have an account?
Satabdi Moharana
Trigger to update parent object with highest priority picklist value from the child object
I have 2 custom object, parent__c and child__c. I have a status__c field in child__c which is a picklist field with value a,b,c,d,e. The picklist values have priority like a>b>c>d>e. Need to write a trigger to update parent__c status with highest priority status from child__c.
you can use below code
I am not getting your priority releated point. if you need help further please let me know.
Please Mark it As Best Answer If it Helps
Regards
Mukesh
You can try the below snippet:
I have the above snippet for the insert and you need to insert the before update snippet in above code.
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.
Thanks.
Hi Satabdi,
Please find the solution.
I hope it will you.
Please mark it as Best Answer so that other people would take reference from it.
Thank You!
My requirement is, let's say for parent p1 there are 3 childs c1, c2, c3 with statuses as a, c, d respectively, then the status of p1 should be a.
Similarly for parent p2 there are 2 childs c4, c5 with statuses as b, d respectively, then the status for p2 should be b.
the priorities of statuses goes like a>b>c>d>e. Please help me with the code.
Regards,
Satabdi.