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
NANCY1NANCY1 

Urgent: How to Invoke Trigger from another Trigger or Workflow.

Hi All,

 

I have Two Objects with Master Detail relationship.

 

I have written a trriger on the Detail object to update a field say 'Field A' of the Master object. The Same field 'Field A' is also getting updated with a Workflow on the Master Object. Now, once my workflow's condition gets satified. my field gets updated.. i am ok with that...

 

But the problem comes when my workflow condition gets failed.. i want the value from the Trigger should get now updated..

 

 

I mean once my workflow condition gets False.. the trigger should get fire to update that field...

 

The trigger on the detail object is written on After Insert, After Delete events..

 

I hope that i am able to explain the problem....

 

please suggest,..

 

 

 

 

 

ngabraningabrani

Couple of suggestions/comments -

a) Triggers cannot be called. They are automatically invoked at the time of insertion, save, delete etc. So if the Trigger for detail needs to call Trigger for Master object, in the Trigger code we can get the Master object and do a Save on the Master object. This should call the Trigger on the Master.

 

b) In addition to after insert, you may also want to add after update condition to Trigger prerequisite.

NANCY1NANCY1

This seems trickey..

 

can you please provide me sample code for this...or you suggest where can i refer it....