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

Announcements

No record found.

News and Announcements icon
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 !!!
I have the same question (0)
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    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();
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,799 Super User 2026 Season 1 on at
    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 473

#3
Adis Profile Picture

Adis 284 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans