Press ESC to close

Customizing the Consolidation Rules for Purchase Requisition Lines in D365 F&O

Title: Customizing the Consolidation Rules for Purchase Requisition Lines in D365 F&O

Introduction

This blog details the functional requirements and design enhancements implemented to modify purchase requisition (PR) combination rules in Microsoft Dynamics 365 (D365). The new customization refines PR combination criteria, ensuring requisitions are grouped only when they share the same vendor and delivery address, providing a more streamlined and efficient ordering process.

Business Process:

In the standard D365 system, purchase requisitions can be combined based on various parameters, potentially merging requisitions across vendors or delivery addresses. This default setup can introduce operational inefficiencies, complicating inventory management and the receiving process. The revised combination rules are designed to mitigate these issues by only allowing PRs to be merged if they originate from the same vendor and share a single delivery address. This optimization improves logistical accuracy, strengthens vendor relationships, and enhances the overall order fulfilment process.

Functional Requirement:

To address the business needs, the following combination rules have been implemented:

  • Vendor Consistency: Only requisitions from the same vendor will be eligible for consolidation.
  • Delivery Address Matching: Requisitions must share the same delivery address to be combined into a single purchase order.

 

Customization Flow

  1. Default Combination Rules in D365 F&O
    • A brief overview of the standard PR-to-PO combination process, which typically consolidates PRs based on parameters such as vendor, requester, and line type etc.
  2. Business Need for Enhanced Consolidation Rules
    • Explanation of the inefficiencies in the standard setup, where PRs may be grouped despite differing delivery addresses or vendors, leading to logistical complications.
  3. Implementing the New Combination Logic
    • Description of how the new logic consolidates PRs into POs only when both the vendor and delivery address are identical.
    • Technical Setup: Outline the checkbox setup for consolidation by address. When checked, the system applies the new rules; when unchecked, it defaults to standard D365 combination logic.

      D365 F&O > Purchase order split rules:
    •   Requestors
    • Line types
    • Procurement and categories
    •  Consolidated by accounting date



 

        D365 F&O > Custom Purchase order split rules:

  •        By address
image.png


 Technical Overview:

Include code snippets that demonstrate:

  • The setup of the new checkbox for enabling consolidation by address.
  • Code defining and applying the vendor and delivery address matching rules.
  • Example output of consolidated POs based on the enhanced logic.

   

Step 1:

Navigation:
Procurement and resourcing > setup >Purchasing Policy
 

 

After clicking Purchase policy > select the ‘Purchase order creation and demand consolidation rule ‘> add new rule > if already defined the click on ‘never’

 

 

In this form we Set up the split rules as our requirement, first we have to add a new check box , named as Address

 


 

 Step 2:

First we have to add the check box , Address in the Set up split rules form:

  Add new field in PuchReqSourcingSplitRule table .


 

Add on PuchReqSourcingSplitRule form.

 


 

After build sync the Project it look like:

 

image-1.png


 

Step 3:

If user set up the policy and check the Address checkbox as ‘Yes’ then after selecting 

 


 

Consolidate the Purchase Requisitions Lines:

 

Navigation:

Procurement and sourcing > Purchase Requisitions > approved Purchase Requisitions Processing

 

 

Step 4:

Create a COC of the following classes and write a code as directed in the following snapshots.

1:

First to add extension of  PurchReqTmpSourcingPolicyRule  table in the project

>Add the field of Delivery address.

 

2:

Create a extension of RequisitionPurchaseOrderGenerationPolicy class and add parm methods:

 


 

3:

 

4:

 

5:

 

6: Create a private method isbugdget ,that is called in this system class but not accessible in COC. So extend a method by we write in a COC class of  RequisitionPurchaseOrderGenerationPolicy 

 

7: Add a class RequisitionPurchaseOrderGeneration  , create a COC and write the following code 

 

8:  In the customization, the PurchReqTmpSourcingPolicyRule   table will be sorted by the delivery address when the newly added " Address" checkbox is selected Yes , the code will execute a sorting function that orders the table by delivery address , If the checkbox is not selected, the system bypasses the custom sorting logic and instead uses the standard, out-of-the-box query for splitting PR lines into POs.

 


 

 

After this ,build and sync the project.

Step 5:

Create a PR lines and after the workflow Approved status, select the PR lines and click on Purchase Order ,

Navigation :

Procurement and sourcing > Purchase Requisitions > approved Purchase Requisitions Processing

 



 

In the above PR lines, 2 lines have the same delivery address and 2 have the different delivery address , So two Purchase Order created on Same Vendor after this customization.