Good afternoon,
Whole day's research on how PO confirmation versions works left me wondering what is the best approach of turning the order to unconfirmed mode, so later it can get confirmed and get a new version?
I understand that if you change something that changes the purchase agreement, such as order line's quantity or order's payment terms, by default turns the order to unconfirmed state. I see the default code for it, but I'm struggling to follow the logic in case I wanted order to become unconfirmed after I change something, what is not considered as change of an agreement by default. Say, internal/external notes fields from DocuRef table, that are associated with the order and shown in PurchTable form?
What logic should I follow in this case?
Thank you!
*This post is locked for comments
Hi Sohaib,
I am also stuck with a similar type of issue,I first confirmed the purchase order and later I relaise that i need to change the buyer group on header and the moment I change buyer group on purchase order header, system not taking me back to re-confirm the purchase order again and the confirm tab is grid off. I tried to do the same on standard AX, and it behaves in the same way. Is it a standard functionality of AX ?? I tried both the way, with or without using workflow.
Look forward for your valuable response.
Thank You
Hi Donatas, i need to prevent re-confirmation when trying to update itemtaxgroup field, in which class this code should be added? Thanks
Hey Donatas,
I have also came across some what the same issue, and what i did to cater the scenario is;
I created a new class extends from VersioningPurchaseOrder and Added a added a method from parent,
which sets the purchTable Modified field to TRUE to be picked for COnfiramation.
public void markModified()
{
super();
purchTable.IsModified = NoYes::Yes;
}
and finally I initialized the class and called 'markModified' method after super call.(You can do it in field modified as well) . In my case i did in clicked method.
Let me know if it worked for you as well.
Hi Donatas, Did you manage to find a better way of doing this?
I think I may have found it!
purchTable.type().updateDistribution(); purchTable_ds.reread(); purchTable_ds.refresh();
Putting it simple - after my custom field in PO form gets modified, I expect Purchase > Confirm button to become active, so after clicking on it a new version of Purchase order confirmation will be generated.
When I run your solution in modified() method of my custom field, the purchLine object is filled up with the information of the first line of the order. I haven't drilled down more, I'm afraid.
Thank you!
Hi
What happens when you execute my or other solutions? What are you expecting to occur?
Thank you, Jonathan. Yes, that's something similar to what I'm looking for, but unfortunately your solution didn't worked, even though it didn't returned any errors.
So I'm trying these little code snippets that I find in PurchLine and PurchTable objects, but nothing seems to work, and I fail to see a common code that is being shared between those elements, that are breaking the agreement.
As AX documentation puts it "The purchase order is the most complex use of the versioning pattern in Microsoft Dynamics AX 2012.".
I'm hoping to find that "single line solution" somewhere :)
I'm not sure if this is what you are looking for, but you can try the following (Taken from purchLineType.update() )
purchLine.updateWorkflowState(TradeWorkflowState::NotSubmitted);
purchLine.purchTable(true).updateFromPurchLines(false);
I think its totally a manual decision which is needed to be taken by business owners. They are the one who know that on changing of what it should trigger the re-confirmation of PO.
for you being a technical person, you may create a setup, where there can be selection of fields from PurchTable and PurchLine. By selection of any field(s) on this setup, it would specify that on changing of data on theses fields, system should trigger/ask for re-confirmation of PO.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156