Hi,
Can anyone please guide me how can I confirm the cancelled PO through X++.
Scenario is; I have been creating and cancelling POs through code which is working fine, all I need to confirm PO once it is cancelled. I have tried below code and it worked fine to confirm only open purchase orders but did not work for cancelled POs.
purchTable = PurchTable::find(purchId);
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PurchaseOrder);
purchFormLetter.update(purchTable, purchId);
When I checked PurchFormLetter and PurchFormLetter_Confirmation classes and did not find any parameter difference which could make it run for open purchase orders and not for cancelled ones.
Any help would be appreciated.
*This post is locked for comments
Hi, is there any update on this issue?
hi,
were you able to find the solution for this issue ?
Thanks for your response Nitesh.
Here what I want to achieve and it works with manual click functionality in AX 2012
1. Create PO; Purchase status = Open order & Approval statue = Approved
2. Confirm PO; Purchase status = Open order & Approval statue = Confirmed
3. Cancell PO; Purchase status = Cancelled & Approval statue = Approved
I want to confirm cancell PO now with code, If I click on Confirm buttion under Purchase Tab it works and changes Approval status to Confirmed. However, I want to do this through code.
Hope that helps to understand the requirement.
actually as I understand.. once you cancel and purchase order, purchase line will not have InventTrans. and hence it is not possible to have PO confirmation or any update.
In standard also if PO is in status cancelled then Confirmation and other update option is not available.
Please verify and update us with your findings
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156