Normally if you click on POST button of any transaction screen it will fire all the standard validations of Accpac and if all the validations PASS it will post the transaction, however if any of the validations fail then Accpac will pop up a error message and won’t post the document.
This is standard behavior, but we often get requirements from end user to add custom validations over and above Accpac’s standard validations, Say for instance; someone may require PO Number as a mandatory field in Order Entry Screen which should be entered by user before posting the document.
Adding validation is not a big deal, where people often get stuck is “How do I control the Posting routine of Accpac so that if My validation fails Accpac Does not Post the document?”
It looks like a challenge until you discover the method to do it, but once you know it, it’s as simple as setting a variables value. Just to save your time here is how to do it
On AccpacOE1100UICtrl1_OnUIAppOpened event first set the data source.
Then on data source change event put your verifications.
condition could be a variable coming from your validation if it’s true that means your validation passed if it’s false that means it failed.
As you can see from the above snippet “Pstatus” is a parameter and posting can be controlled through it. In order to restrict the posting set Pstatus = Status_Cancel and to continue the posting set it to Status_OK.
Hope this helps.