Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Confirm cancelled purchase orders?

Posted on by 10,794 User Group Leader

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

  • Raj Borad Profile Picture
    Raj Borad 492 on at
    Confirm cancelled purchase orders?
    Hi Faisal,
     
    I want to know the reason for confirming the purchase order which is already canceled.
    I found this blog from internet. Hope it will helps you to solve the query.
     
    Thank you,
    Raj
  • Shaik146 Profile Picture
    Shaik146 932 on at
    Confirm cancelled purchase orders?
    Hi all,
     
    Does anybody solution to this post, i'm also facing similar requirement,
     
    i. Once PO is cancelled and submitted for approval, have to do PO confirm using code instead of using the front end.
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Confirm cancelled purchase orders?

    Hi, is there any update on this issue?

  • Anitha Eswaran Profile Picture
    Anitha Eswaran 312 on at
    RE: Confirm cancelled purchase orders?

    hi,

    were you able to find the solution for this issue ?

  • Faisal Fareed Profile Picture
    Faisal Fareed 10,794 User Group Leader on at
    RE: Confirm cancelled purchase orders?

    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.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Confirm cancelled purchase orders?

    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

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans