Trigger does not always work

Posted by Rollbase User on 17-Feb-2010 22:01

I have a trigger in object C that updates a field F1 in object B. I have another trigger in object B that updates a field F2 in object A. The trigger in object B is run everytime F1 is changed. When trigger in C is run, it updates F1 successfully. However, even if there is an update in F1, the trigger in B is not run. As such, the field in A is not changed. This is a wrong behavior because the trigger in B is designed to run each time F1 is changed. Formula fields would have eliminated the need for this trigger. However, formula fields cannot be used in Query APIs which i also need to do. HELP!

All Replies

Posted by Admin on 18-Feb-2010 10:05

Akira,

This is expected behavior so thanks for reporting it. Can you submit this as a support ticket with the names of the objects and triggers so we can reproduce? We also need to know your username so we can check the appropriate account.

Most likely this will be an item for Pavel to follow up with you on when he returns next week.

Regards,
Matt

Posted by Admin on 18-Feb-2010 19:52

Done with the support ticket. thanks!

Posted by Admin on 23-Feb-2010 18:00

We do not run triggers when another trigger does some update, since this may easily lead to cascading events and other undesirable effects. However if you want programmatically run triggers on related objects you can do so by using "Update Related Records" trigger.

Posted by Admin on 23-Feb-2010 23:30

Same issue...

Update related records trigger can only fire a related record's trigger. However, what i needed is to fire a trigger in the related record's related record. I still need a cascade to do that.

I have several issues for updating related records
1) for every field update, i need one trigger which means that if i have 3 fields to update, i need 3 triggers
2) i have a scenario a scenario where in i will close a Contributor object. That would mean closing accounts related to this contributor and closing all investments under each account. Since cascade is not possible and only related records can be accessed from Contributor, I cannot close the investments when closing the contributor.

Posted by Admin on 24-Feb-2010 11:07

1) I don't see anything wrong about it. You need 3 formulas for 3 fields. How you can merge them into 1 trigger?

2) Try close all accounts prior to closing a contributor. You can enforce this by using validation triggers.

This thread is closed