How to deal with an entry point called twice.

I've been working on a workflow that triggers on creation of a shipment.  I'm sure you're aware that these workflows will work just fine when creating the shipment manually, but when leveraging the batch tasks FUNAUTDLV and FUNPREDLV, the workflow doesn't trigger on the SDH object.

That's all fine since I've found a means of triggering a workflow using the entry point AUTDLVMAJ which is called after the creation of the shipment.  This works quite well for FUNAUTDLV, but for some odd reason, the AUTDLVMAJ entry point is called twice in the FUNPREDLV.  I'm using the entry point for the purpose of triggering a workflow on "Function start".

Since the AUTDLVMAJ entry point is called twice in FUNPREDLV, it means it triggers the function twice and so two workflows are triggered for each shipment generated.

Hence the subject line:  How can I deal with an entry point that is called twice when I want to use it once?

  • I've added a bit of an inelegant solution to this.  Would prefer something better but I've created a log table of a sort so I can limit it to only trigger once per document generated.  If anyone has a better solution to this, I would love to hear it.