0

I have created the custom field in salesforce checkbox field as true, if a record changes in order object after the trigger process runs a single time , then it will go to process builder and update the checkbox field as false

For Process Builder action:

How to implement the process Builder action in trigger code? if anyone Knows Guide me for the Answer

Is it Possible to execute the trigger code only once using Process Builder in After Update Trigger

what is the use of @InvocableMethod? what it will do? It is used to call the Process Builder Action

  • Am I clear that you want to implement trigger's logic after execution of process builder? – EvAzi Dec 15 '16 at 13:09
  • implement triggerlogic after that execution of Process builder@EvAzi – SFDC Dec 15 '16 at 13:11
1

Order of execution is: Triggers - WFs - Flows(Process builder). You can't change order of execution. In your case, IMO, it would be better to set this checkbox to false directly in trigger's "after update" event.

@InvocableMethod is the notation that allows to call apex from process builder (and most likely from some other declarative-related things). But I strictly recommend not to use InvocableMethod in process builder, since this method will be called for every record that goes through process builder. Which means, if you have a SOQL request in your invocable method - your code will fail if you'll try to insert more than 100 records. If you have 2 SOQLs - code'll fail on 51th record and so on.

In your case it would be most logical to implement the logic in trigger itself.

Not the answer you're looking for? Browse other questions tagged or ask your own question.