I want to check my PO when it is create /automatically/ from Web API. So the logic is this Web API will trigger PO creation, and while inserting each the Purchase Lines, I want the code to also run Budget Checking.
May I know how to implement this ?
I was told that I need to make use of class BudgetControlProcessor, however I have limited knowledge about how to use it exactly.
Basically, when it does not have budget during this processing, The Web API should return /false/. I know how to return the API to false, what I don't know is how to do check Budget according to my Budget Register Entry.
How to make use of BudgetControlProcessor for PO ?
Hi Kevin,
Yes, that exactly what I have in mind, but don't know how to make use of that BudgetControlProcessor. And to do reverse engineering to what standard doing, unfortunately is beyond my skill.
How to make use of BudgetControlProcessor for PO ?
Hi,
Regarding what you said about running the check code after creating a PO through the API, you need to integrate the BudgetControlProcessor class for budget checking in the code that handles the purchase order creation and purchase line insertion. If the budget check fails, you can return false from your web API to indicate that the purchase order creation process has experienced a budget overrun.
How to make use of BudgetControlProcessor for PO ?
Hi Ken,
I also don't have experience in calling the budget checks from X++ coding.
To be able to learn more about what class and method to use, you can reverse engineer the form design of the purchase order details. You can then check how the budget check is executed.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.