web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Invoking purchase order confirm buttons to true

(0) ShareShare
ReportReport
Posted on by 2,365

Hi,

I have added a new field to the Purchase line, and I want to require the user to re-confirm the PO when the field is changed. What method or following lines of code, do I need to use to include the new field to do this.

Ex. Qty field when changed needs to reconfirm the PO, the buttons are re-enabled when the qty field is changed. I need the same functionality for a custom field.

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,024 User Group Leader on at
    RE: Invoking purchase order confirm buttons to true

    You can make use of VersioningPurchaseOrder class. find below logic.

    1) Create a PO

    2) Confirm the PO

    3) Check Status of PO

    4) Now run below code by providing correct PO Number in job.

    5) Check status of PO. Confirmation button is enabled again.

     PurchTable purchTable,purchTable_Orig;
        ;
        purchTable.clear();
        purchTable_Orig = PurchTable::find('000015',true);
        purchTable = PurchTable::find('000015',true);
        
        
        ttsBegin;
            VersioningPurchaseOrder::newPurchaseOrder(purchTable, true).change(purchTable, purchTable_Orig);
            purchTable.IsModified = NoYes::Yes;
            purchTable.type().updateDistribution();        
        ttsCommit;
        
        info('Ok');


    //you can use same logic for your customized field

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans