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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Rules for re-approval of PO when value is changed

(5) ShareShare
ReportReport
Posted on by 49
Hi,
We are running D365FO version 10.0.41 with change management activated on POs.
We set the workflow to check on the Delta invoice amount to determine if re-approval is neccessary: If the value is over a certain amount, the PO should be re-approved. However, the calculation does not consider changes in charges on the PO lines. 
Anyone found a way to include the charges in the considerations?
I've tried setting up the policy rule to check for changes in charges, but then it will check even if the change is minimal. It should only be re-approved if the value is over a certain threshold. 
 
I appreciate any feedback you might have.
I have the same question (0)
  • Verified answer
    Holly Huffman Profile Picture
    6,544 Super User 2025 Season 2 on at

    hi there! this sounds like it may need customization to fit your need: 

    • Custom Workflow Extension:
      • Create a custom workflow extension to handle the re-approval logic. This extension will check for changes in both the PO amount and the charges.
    • Calculate Total Change:
      • Implement logic to calculate the total change in the PO value, including both the line amounts and the charges. This total change will be used to determine if re-approval is necessary.
    • Set Threshold for Re-Approval:
      • Define a threshold value for the total change. If the total change exceeds this threshold, the PO will require re-approval.
     
    ex: 
     
    public class CustomPOApprovalWorkflow extends WorkflowDocument
    {
        // Define the threshold for re-approval
        private const real ReApprovalThreshold = 100.00;
        // Method to check if re-approval is necessary
        public boolean isReApprovalRequired(PurchTable _purchTable)
        {
            real totalChange = this.calculateTotalChange(_purchTable);
            return totalChange > ReApprovalThreshold;
        }
        // Method to calculate the total change in PO value
        private real calculateTotalChange(PurchTable _purchTable)
        {
            real totalChange = 0.00;
            PurchLine purchLine;
            PurchLineCharge purchLineCharge;
            // Calculate change in line amounts
            while select purchLine
                where purchLine.PurchId == _purchTable.PurchId
            {
                totalChange += purchLine.LineAmount - purchLine.OriginalLineAmount;
            }
            // Calculate change in charges
            while select purchLineCharge
                where purchLineCharge.PurchId == _purchTable.PurchId
            {
                totalChange += purchLineCharge.ChargeAmount - purchLineCharge.OriginalChargeAmount;
            }
            return totalChange;
        }
    }

     

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

News and Announcements

Season of Giving Solutions is Here!

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 243 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Sagar Suman Profile Picture

Sagar Suman 78 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans