Skip to main content

Notifications

Announcements

No record found.

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

(6) ShareShare
ReportReport
Posted on by 33
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.
  • Verified answer
    Holly Huffman Profile Picture
    3,254 on at
    Rules for re-approval of PO when value is changed

    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

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,025 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans