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)

Changes to the document are only allowed in state Draft, because change management is activated

(0) ShareShare
ReportReport
Posted on by

We are experiencing issues with 'Confirming' PO's. The workflow approval is functioning perfectly but when we hit 'Confirm' we get the above error message. I have reviewed the FAQ's and checked google for a solution to no avail.

We have made minor changes and resubmitted....again the workflow approval process worked fine but we still cannot confirm the order.

Is there a solution to this issue?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    guk1964 Profile Picture
    10,886 on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    That is the usual cause

    One other workaround you can explore is the parameter in vendor master called override change management. Try to do it for that vendor.

  • Community Member Profile Picture
    on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    Accurate answer . I went through the same issue and solved as suggested by Sherif Abolsaud.

    Thank!!

  • Suggested answer
    Sheriffff Profile Picture
    35 on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    Al Salam Alaikom from EGYPT,

    I don't know why everybody are going to hard code everything! any way here are my answer:

    Yup, I analyzed and successfully resolved al 7amd le Allah:

    I believe that this error occurred when AX is trying to update the total PO balance, which means it did not continue the "Totals" calculation before the moment of submitting the PO.

    While you open the PO and in another cases while you are trying to re-submit a PO after "Request change" and making any change affects the PO balance, AX is trying to calculate the balance and trying to type it in the respective fields, along with that, AX prevents any change in any field while not in "Draft", that's why AX is giving you this error.

    Resolution: Simply, after create the PO, user have to click on "Totals" button (so AX will update the respective totals fields), then Submit the PO workflow.

    Or, you can add that piece of code in the Submit action, if applicable.

    sherif.abolsaud@gmail.com

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    Hi,

    Disable the Change management for each LPO using the below code and then try again; it should work;

           PurchTable       purchTable;
    
           ;
    
           select forUpdate purchTable where purchTable.PurchId == '000532';
    
           if(purchTable) {
    
               purchTable.ChangeRequestRequired = NoYes::No;
    
               purchTable.DocumentState = VersioningDocumentState::Approved;
    
               purchTable.update();
    
               info(strFmt('%1',purchTable.DocumentState));
    
           }


  • Community Member Profile Picture
    on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    Hi Steven. That's a great answer! You are correct in that I am commenting out a valid AX error...but until I can find what is causing this handful of PO's to throw the error, I have no other way of getting them confirmed. So far I have not experienced any flow-on effects from using this method. I do however get a class versioning check warning when I comment out the error message.

    I am using customised purchase order workflows with the assignation set to role-based - security role participants.

    I'd love some further information on your method of sorting this out via SQL.

  • Steven Harvey Profile Picture
    20 on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    Hi Simon

    The ChangeRequestRequired  is the correct flag.

    I have had a similar problem before where the purchase order workflow was incorrectly customised and resulted in the "Changes to the document are only allowed in state Draft, because change management is activated" error.

    Sounds like you are commenting out a line of code that was intended to throw a valid  error in AX? And then manually trying to force the status field to confirmed? Doing this will most likely result in further problems for you.  When purchase orders are confirmed there is more that happens than just a status field update.

    Are you using the standard purchase order workflow? or a custom one?

    Anyway the way I sorted out the problem I had on the handful of purchase orders was to update the ChangeRequestRequired field directly in the data for those purchase orders (through SQL). And then run the confirmation as normal on the purchase order in AX (So don't try and change the status field manually before)

    Updating this field directly in SQL for  those orders will bypass the versioning check in AX and allow you to confirm the orders (I guess this versioning check is the "error message line" you are commenting out in order to save the record?)

    I have no idea what was done through customisation in your system , or what the current state of the data is so please try this in your dev environment first.

    While updating data directly through SQL is also not always necessarily the best idea, sometimes it has to be done. be careful when doing so.

  • Sohaib Cheema Profile Picture
    48,472 User Group Leader on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    well, commenting further, on your thread is hard, unless you share call-stack with us.

    In addition I don't have AX2012R2 to debug at my end. :)

  • Community Member Profile Picture
    on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    I believe the 'class versioning document' is where the flag/error may be located but I do not know how to view this.

  • Community Member Profile Picture
    on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    My workaround for this issue is to locate the purchase order in the PurchTable, uncheck the ChangeRequestRequired checkbox and save, then change the DocumentState field to "Confirmed" and save, then re-check the ChangeRequestRequired checkbox and save at which point the system throws this error message. I double-click on the error message, put \\ in front of the error message line and save, go back to the PurchTable and save, then go back to the error message and remove the \\ and save.

    Obviously there is a flag somewhere against the handful of PO's that throw this message that I cannot locate.

  • Sohaib Cheema Profile Picture
    48,472 User Group Leader on at
    RE: Changes to the document are only allowed in state Draft, because change management is activated

    there is a field named as ChangeRequestRequired inside PurchTable.

    in majority of cases, that becomes culprit

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans