Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

Posted on by 5,901

hi All,

auto submit workflow in purchase order in AX 2012 r3 - Microsoft Dynamics AX Forum Community Forum

Finally I git the solution and able to submit the PO workflow.

I have added below code also

To Disable the change management

PurchTable       purchTable;
;
select forUpdate purchTable where purchTable.PurchId == "PO-0006371";

if(purchTable) 
{
    purchTable.ChangeRequestRequired = NoYes::No;
    purchTable.update();
}

Kindly let me know , *** before I am getting below error ---

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

@@ When I disabled the change management then successfully auto submit the workflow without error.

1. What is change management ? And what is does?

2. Now I disabled the change management , Is it do any impact on workflow? I mean my workflow ( auto submit) will work as same like manual submit workflow ?

Please give me more shed on this.

thanks!

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,253 Super User 2024 Season 2 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Hi @rp@n,

    You are getting the error only with your customization or also when you submit manually? If it is with your customization, check if the coding is correct. Not sure if you need to set the workflow status on the purchase order yourself. Maybe, it will already be done by activating the workflow. If this is not the case, then try to first update the workflow status on the order; then activate the workflow.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Andre, Rachit, please reply me on this.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Andre, my issue is I am getting an error when submitting the workflow in PO

    Changes to the document are only allowed in state Draft, because change management is activated. " while submitting the workflow.

    *** If I disable the change management  by code, as I mentioned in above then no error and workflow submitted successfully. 

    @@ But as you suggested , the disabiling change management is not good approach. That's why I am asking how I will resolve this issue without disabling the change management?

    I hope you understand. 

    Please give me more shed on this. 

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,253 Super User 2024 Season 2 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Hi @rp@n,

    What is your issue? In this thread you only asked about what is change management and what happens if you disable it.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Thanks Rachit and Andre,

    I am agreed with your answers.  Finally let me know how I will resolve this issue?

    Please give me more shed on this 

  • Suggested answer
    Rachit Profile Picture
    Rachit 4,015 User Group Leader on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    hi @rp@n,

    There is no silver bullet answer to your question. It will create inconsistencies in your table records and workflow history tables. Bypassing setups via code will also lead to situations where the system behavior will not be in sync with the setups as you are bypassing the setup rule. I agree with Andre that this is not a best approach.

    These things should  be controlled by configurations only.

    Hope this helps.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Thanks Andre,

    Kindly let me know, what kind of side effects can happen if I disabling the change management and perform workflow.

    Please give me more shed on this 

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,253 Super User 2024 Season 2 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Hi @rp@n,

    If you don't have issues anymore, I think you have a solution. However, it doesn't seem OK to me disabling the change management. It could have another side-effects. But I haven't came across your requirement before.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Andre, I am facing the issue before  but after disable the change management , the issue is resolved. And able to auto submit the PO.

    If anything else please let me know 

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Error - Changes to the document are only allowed in state Draft, because change management is activated during auto submit workflow on PO

    Thanks Andre,

    I have added the code to disable change management and able to auto submit the workflow now. And also workflow shown in completed atatis.

    Is any other things to check??

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

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

Product updates

Dynamics 365 release plans