I have a flow which creates the Order record and also there is an after insert trigger on Order.I am trying to understand which one executes first

I have assignment of Order shipping address on Fast Create element from flow and in trigger there is an update of shipping address.But it looks like some action which is not shown in the debug log the address is getting deleted.

here is the history on the order record

enter image description here

  • 1
    Where in the flow is the Order shipping address being updated? If you're setting the address on an sObject variable or specifying the field values on a Record Create or Fast Create element, then those values would be inserted, and then the after insert trigger would fire and overwrite them. If you're doing the Record Create/Fast Create first, and in a subsequent Flow step you're updating the shipping address fields and updating the record, then the after insert trigger would fire on the initial insert, but not again on the update. Mar 27 '15 at 19:03
  • I have shipping address assignment before the FastCreate element
    – sfdc
    Mar 27 '15 at 19:09
  • In your picture, which of those actions is being taken by the trigger? Mar 27 '15 at 19:28
  • trigger is updating the address to 1250 20th St NW,Washington
    – sfdc
    Mar 27 '15 at 19:29
  • 1
    I figured it out there is actually an update of status in flow which is setting the address to null.Thank you Thomas
    – sfdc
    Mar 27 '15 at 19:55

Since you're setting the address fields on an sObject variable and then using a Fast Create element, those values would be inserted initially, and then the after insert trigger would fire and overwrite them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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