Hi all,
Sometimes you want to start an action or session right after an http post to BC. The annoying thing is that it is not possible to determine when a HTTP request is compleet and successful. No event can be used to start something afterwards. There are ways but i will mention those in the workaround, but in my mind something like this is crucial for building solid solutions.
My idea:
My suggestion is to make it possible to subscribe to an event of the api page when a request was successful. Also this needs parameters of the records it got posted. So lets say you post a sales order header and lines to business central. Then when all the headers and lines are in and the request was successful (code 400) it should raise the event. Or even better, raising the event per part of the page.So an event for the sales header and for the saleslines.
Work arounds for now:
In the current functionality i am forced to workaround it, but is never ideal:
- calling an extra action after the post, which is often not possible when building with third parties because they have to build an extra posting logic in there httprequest structure.
- filling an extra field with a "last line" boolean, which indicates the last line and i can start a session from. Which is also not always possible with third party solutions, because of default posting bodies.
- starting a session that first sleeps and then check if there are more lines after the last check. Which is not really good practice at all and relatively slow, but sometimes the only way.
- making a job queue to process the lines commited only. (which is also not fast nor good practice).
All this together begs for a better way to handle HTTP Post recieval.
Thank you.
