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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Auto populate Buyer Group from Purchase Requisition to Purchase Order during Batch PO Creation

(3) ShareShare
ReportReport
Posted on by 74

Requirement:
Auto populate Buyer Group from Purchase Requisition to Purchase Order during automatic PO creation through batch job in D365FO.

Scenario:

  • BuyerGroup field added in PurchTable.

  • Purchase Requisition goes through RFQ process.

  • RFQ is accepted/rejected.

  • After requisition approval, batch job creates Purchase Order automatically.

  • Requirement is to transfer BuyerGroup value from Purchase Requisition to PurchTable during PO creation.

Analysis:
Batch class PurchReqPurchaseOrderGenerationBatch only creates release strategy batch tasks and does not directly insert PurchTable records.

The actual PurchTable preparation happens in class:
PurchAutoCreate_PurchReq

Standard method identified:

public void createPurchTable()
{
    purchTable.setPriceDiscChangePolicy(PriceDiscSystemSource::PurchaseReq);
    purchTable.initInvoiceAccount();
    this.copyPurchReqDeliveryDateToPurchTable();

    purchTable.calculateRequestedShipAndReceiptDate(
        dateNull(),
        purchTable.DeliveryDate,
        SchedDirection::Backward);

    purchTable.SkipShipReceiptDateCalculation = true;

    super();
}

Question:
What is the best practice to populate custom BuyerGroup field into PurchTable during automatic PR to PO creation?

  • Should the value be assigned before super()?

  • Or should CoC extension update PurchTable after creation?

  • Has anyone implemented similar customization in PR → RFQ → PO auto generation flow?

Categories:
I have the same question (0)
  • Suggested answer
    Subra Profile Picture
    1,247 on at
    Hi @Roja C-30061119-0

    Did the purchase requisition buffer is availble in the same method?  if yes, you can use the COC and assign the value for your field.
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • Martin Dráb Profile Picture
    239,684 Most Valuable Professional on at
    The primary method of PurchAutoCreate_PurchReq class for initializing PurchTable is setPurchTable(), not createPurchTable(). It utilizes PurchTableUpdateFromPurchReqLineMap, which you may need too.
     
    I'm no expert in requisitions, but I think there may be multiple requisitions for a single purchase order, while your design incorrectly assumes that there is always just a one.
  • Roja C-30061119-0 Profile Picture
    74 on at

    Thanks, Subra.

    Yes, the purchase requisition buffer is available in the same method. I checked the standard class, and the purchReqTable buffer is already declared and initialized in PurchAutoCreate_PurchReq.

    So, I used a CoC on setPurchTable() and assigned the value directly without adding additional select statements.

    void setPurchTable()
    {
    next setPurchTable();
    PurchRFQCaseTable purchRFQCaseTable;
    if (purchReqTable.RecId)
    {
    purchTable.ItemBuyerGroupId = purchRFQCaseTable.ItemBuyerGroup;
    }
    

    Could you please confirm if this is the correct approach?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 681 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 598 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 579

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans