DynDeveloper.com

DynDeveloper.com

Sign Up Now!Log In
euta226 5/14/2014 9:09:59 AM

Validating PONUMBR in eConnect taPoLinePost fails during creation of PO

I've placed a stored procedure call inside the taPOLinePost stored procedure to execute additional business logic that needs of be processed for each line of a Purchase Order during the creation of that PO.  Part of that business logic is validating the fact that the PO Number exists in the POP10100 table.  I've pulled the following quote from the Knowledge Base section of DynDeveloper regarding the use of eConnect to create Purchase Orders:

To expand on that point, the various parts of an integration are (generally) integrated in the order that they're listed in the documentation. That means that the lines generally go in first. So, for a PO with two lines, you'd get this:

taPoLinePre
taPoLine
taPoLinePost
taPoLinePre
taPoLine
taPoLinePost
taPoHdrPre
taPoHdr
taPoHdrPost

So, since it appears that taPOHdr doesn't execute (and create the POP10100 record) until after the PO lines are created, I need to find another place to execute my business logic. 

My question is, is my understanding correct about the order of execution of the stored procedures listed above and, if so, what/where would be considered "best practice" for executing my business logic for each line of the PO, while validating that the PO exists and how to rollback the entire process if my business logic experiences an error?

Thank you,

James Tyree

Version: GP 2013
Section: Dynamics GP, eConnect, SQL Scripts