Skip to main content

Notifications

Community site session details

Community site session details

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

How to create PO from PR using PurchAutoCreate_PurchReq ?

(2) ShareShare
ReportReport
Posted on by 6
Hi Members,
 
I have a situation where I will be receiving information such as Purch Req Id, item Id, line number and vendor account of PR item from an external system and I would like to create a custom service to get this information and automatically create a PO in D365FO system.
 
I cam across a class PurchReqAutoCreate_PurchReq but do not know on how to utilize this for creating PO . Could you please help me out with a code snippet on how to call this call and create a PO using the parameters in 1st line please.
 
Thanks in advance !!!
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    21,751 Super User 2025 Season 1 on at
    How to create PO from PR using PurchAutoCreate_PurchReq ?
    Hi,
     
    I don't think you need a call PurchReqAutoCreate_PurchReq Class.
    But you can created througt x++.
    Please refer to this.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Layan Jwei Profile Picture
    7,778 Super User 2025 Season 1 on at
    How to create PO from PR using PurchAutoCreate_PurchReq ?
    Hi,

    If you have PurchReqId, why do you itemId and line number?

    I didn't try it before, but looking at the methods available in the class, maybe you can do sth like that?

    PurchReqTable purchReqTable = PurchReqTable::findPurchReqId("YourPurchReqId");
    purchAutoCreate = PurchAutoCreate::construct(purchReqTable, this);
    purchAutoCreate.create();
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans