This article describes the code needed to create a VBA mod in GP 10 to keep a user from posting a Payables batch if that user is the one that created the batch.
We take several steps to accomplish this. The first step is a SQL trigger that records the user id in the SY00500 table. Dynamics does not correctly record the user, so we fix that.
Second, we trap the Origin_Changed and BatchID_Changed events and we look up the batch in SY00500. Based on the userID there, we enable/disable the post button on the form.
There is a bug in this form, the BatchID and Origin_Changed events don't fire correctly when the user looks up a '2' document. We get around that by trapping the PostingDate_Changed event.
Also, an error occurs if you try to enable the post button when the last document was a type '2'. We get around that by using an empty error handler.