+ Start a Discussion
KCLKCL 

Trigger on Chiled object when parent object field is updated

I Have parent Object and child object 

Parent: state
Parent Field: Status(picklist Field): values are:(IN,OUT)
Child :city
Child Field: Yes(Check Box)

Need help in writing a trigger : 

Scenerio:When ever picklist values are changed ex: IN to OUt  or OUT to IN The trigger need to Check the YES filed and immediately and then Uncheck.
 
Best Answer chosen by KCL
SATHISH REDDY.SATHISH REDDY.

Yes, we can update the child records & access its fields to check for specific criteria

Check this example which i tried for you between Opportunity & opportunityLineItems

Please go through this https://help.salesforce.com/articleView?id=000340214&type=1&mode=1

Please mark it as the best answer if this helps.

Cheers!
Sathish

All Answers

SATHISH REDDY.SATHISH REDDY.

Hi there,

Why don't you use the process builder where conditions would be "everytime created or edited" & replicate the above conditions.

Please mark it as the best answer if this helps.

Cheers!
Sathish

SATHISH REDDY.SATHISH REDDY.

Yes, we can update the child records & access its fields to check for specific criteria

Check this example which i tried for you between Opportunity & opportunityLineItems

Please go through this https://help.salesforce.com/articleView?id=000340214&type=1&mode=1

Please mark it as the best answer if this helps.

Cheers!
Sathish

This was selected as the best answer