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
Sid LightningSid Lightning 

Update child object field from another child object field by apex trigger ?

Hi,

I have an order object, it has 2 childs, NPS and Cases

On NPS, I have a lookup to cases. but both gets filled seperately

What I really want is, When  NPS rating is "4" on NPS. It should set the status close on all cases with "Type" NPS 4 

Point to remember is there can be multiple cases with this type

NPS rating --- > 4

Cases - type -(NPS4) ---- > Status = Closed

Can somebody help me in writting trigger and test class for the same
Foram Rana RForam Rana R
Hi Sid,

Please Clear some points.
What I understood is : When NPS is insert/update with rating  4 then all cases with type (NPS4)  [What is type - NPS4 ? Is it field or record type on Cases ? ] related to that NPS should be upadted with status = closed. 

Let me know.

Thanks,
Foram Rana