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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Invoke Purchase order re-approval policy rule on a custom field d365FO

(0) ShareShare
ReportReport
Posted on by

I have changed management enabled for purchase order workflow approval. I intend to invoke purchase order re-approval policy rule for a custom field that I have added in table extension of PurchTable and PurchLine table. The custom field is a boolean field, I am changing the field through my code by putting it to false (initially it is set to true) so that workflow sees it as a change in field and assign it to respective approver.

I have added my custom field to purchase order re-approval policy rule fields but it is still auto approving it. Can anybody help?

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi Talbia,

    You can navigate to Procurement and sourcing > Setup > Procurement and sourcing workflows.

    and make sure the workflow's version is Active.

    https://community.dynamics.com/ax/b/galynafedorovaaxblog/posts/msdyn365fo-purchase-order-reapproval-within-change-management-functionality

    regards

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi Talbia,

    Have you also made your custom field part of versioning framework as described here?

    docs.microsoft.com/.../maps-with-versioning

    If you dont make it part of versioning, there wouldnt be possibility of checking the old and current values and trigger reapproval.

  • Community Member Profile Picture
    on at

    Thank you for your reply.

    How can I make it part of versioning?

    Let me give you a brief overview of my scenario, I firm planned purchase orders which generate purchase orders with status "Approved" (ensures an inventory transaction), my code changes that status to draft sends it to PO workflow for approval. As the PO already attained the status of Approved once when it was generated, workflow approves it right away as nothing has been changed. In order to enforce re-approval, I have created a custom field in PurchTable as well as in PurchLine table and I am trying to change that field through my code.  In my re-approval purchasing policy rule, I have also kept this custom field under Purchase order and Purchase order lines but my workflow has condition Purchaseorderslines.requires re-approval=No => Auto approve. 

    My code works fine when I change field on Purchtable (it is being refelected on PO header level) but I cannot figure out how to do it on line level to invoke re-approval.

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi Talbia,

    Have you gone through the link I shared? That guides you exactly how you can extend the versioning framework.

  • Community Member Profile Picture
    on at

    Yes I have gone through that link. I am looking for a way out to accomplish this task without extending table map extension as shown in the link you shared. Because I have tested some manually created POs and tried changing the same custom field and it works fine which means that my custom field is being considered by purchasing policy and version comparison is also taking place for manually created POs but its not working from automatically generated POs by firming planned purchase orders.

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi Talbia,

    When you are setting your custom field? During Purchase order creation or after the PO is created and approved?

    In case you are doing before, you need to do following:

    1. Standard will create PO

    2. It will then approve the PO if Change management is activated

    3. You now need to write logic to bring the PO back to draft state

    4. Now update your custom field.

    When you do manually as well, you first click on Request change button and then update the field  before you submit to workflow.

  • Community Member Profile Picture
    on at

    Hi Sumit,

    Yes exactly. When a PO is created it is in Approved state,

    then my code changes that Approved state to draft.

    Once it is in draft,

    I intend to set that custom field and submit it to workflow for approval again, but my code is not setting that custom field at PO line level.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans