I am trying to update the PO information through code where Change management is active for that PO. I can able to update update the information successfully but when i open the PO through front end i am getting the error as "Changes to the document are only allowed in state Draft, because change management is activated."
Code looks like
versioningPurchaseOrder = VersioningPurchaseOrder::newPurchaseOrder(purchTable, true);
can any one tell me whats going wrong, am i missing some step through code.
its very weird that while opening the PurchTable form system triggers update() on some tables, below is the call stack for error while opening the form
Dynamics.AX.ApplicationPlatform.1.netmodule!Dynamics.AX.Application.Info.`add(Dynamics.AX.Application.Exception _exception, string _txt, string _helpUrl, Microsoft.Dynamics.Ax.Xpp.XppObjectBase _sysInfoAction, bool buildprefix, string _label, bool @_helpUrl_IsDefaultSet, bool @_sysInfoAction_IsDefaultSet, bool @buildprefix_IsDefaultSet, bool @_label_IsDefaultSet) Line 286
Dynamics.AX.ApplicationPlatform.1.netmodule!Dynamics.AX.Application.Global.`error(string txt, string helpUrl, Dynamics.AX.Application.SysInfoAction _sysInfoAction, bool @helpUrl_IsDefaultSet, bool @_sysInfoAction_IsDefaultSet) Line 2406
Dynamics.AX.ApplicationSuite.146.netmodule!Dynamics.AX.Application.VersioningDocument.`change(Microsoft.Dynamics.Ax.Xpp.Common _newRecord, Microsoft.Dynamics.Ax.Xpp.Common _oldRecord) Line 130
Dynamics.AX.ApplicationSuite.146.netmodule!Dynamics.AX.Application.VersioningPurchaseOrder.`change(Microsoft.Dynamics.Ax.Xpp.Common _newRecord, Microsoft.Dynamics.Ax.Xpp.Common _oldRecord) Line 841
Dynamics.AX.ApplicationSuite.85.netmodule!Dynamics.AX.Application.PurchLineForeignTradeCategory.`update() Line 146
public void update()
this.IsModified = NoYes::Yes;
Dynamics.AX.ApplicationPlatform.0.netmodule!Dynamics.AX.Application.FormDataUtil.`DBOpInTransaction(Microsoft.Dynamics.Ax.Xpp.Common _record, bool _isWriteOperation) Line 906
Dynamics.AX.ApplicationSuite.Forms.14.netmodule!Dynamics.AX.Application.Forms.PurchTable.FormDataSource.PurchLineForeignTradeCategory.write() Line 5191
Anyone have any suggestions ?
I have not done this myself. Using the client user interface, you first have to click the action 'Request change'. Have you looked at the coding behind this button?
Same I found few days back while trying to click anywhere in the PO (other than 'Request change' tab), this notification pops up.
The scenario is below.
--- The PO was created say for example on 1st Jan 2019.
--- Both sales tax and item sales tax group were selected in PO line. User had confirmed the PO also.
--- Then there was a requirement from the client to change the tax effective date as they were not yet registered to VAT authority by that time. Therefore, we changed the From date (for example changed from 1st Jan to 1st March 2019) in 'Value' form in sales tax code.
After that when user was trying to proceed with that PO, he got this notification.
The reason what I identified and my understanding on this as per below.
--- As there is a change / update made in sales tax code in later stage; therefore, system was trying to validate the same tax code (which is linked with sales tax and item sales tax group) as it was recorded first time in PO.
--- Now while validating the tax code as recorded before, it was not able to match and update the same just because I modified the Start date in tax code.
Below solution measure I had taken to sort out this.
--- Clicked on 'Request change' first.
--- Removed both sales tax group and item sales tax group from each line of that PO.
--- Selected back again the same sales tax group and item sales tax group in each line in the PO.
After that, it was allowing to proceed further as usual.
Though this sounds typical but this is how it worked :)
Best regardsSourav Dam
Business Applications communities