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, ...
Answered

Get ProjId for those the purchase requisition has been created using x++ code in D365fo

(0) ShareShare
ReportReport
Posted on by 152

how to write x++ code to get the ProjId from ProjControlPeriodTable for those the Purchase Requisition has been created in PurchReqTable using x++ code in D365fo

I have create a custom Form where i brings all records from ProjControlPeriod Form with Range Estimate Status should be in Created Status,
but for this form i need one filter more that it's filter those ProjId , for those the Purchase Requistion has been created ,

I found the relation

ProjControlPeriodTable.ProjIdNew = ProjTable.ProjId

ProjTable.ProjId = PurchReqTable.PurchId

But in my case we don'nt use projidnew field , so we can't use this realtion

Can please suggest me the x++ code to get the ProjId , for those the Purchase Requistion has been created.

Thanks

Sam D.

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi Sam,

    Why can't you use that relation with ProjIdNew field? Can you elaborate.

    Also, there is another field named ProjId in ProjControlPeriodTable. Have you checked that?

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    152 on at

    Because , ProjIdNew doesn't contains data on table , it has been replaced by ProjId

    And From PurchReqTable , there is no direct Relation with ProjControlPeriodTable

  • Verified answer
    GirishS Profile Picture
    27,833 Moderator on at

    You can use ProjId field in ProjControlPeriodTable right?

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    152 on at

    Yes Correct , But in table relation there is no direct relation with Projid with PurchReqTable , that become problem to retrieve the data 

  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    There is no direct relation between PurchReqTable and ProjControlPeriodTable, but you can join using ProjTable.

    ProjControlPeriodTable(ProjId) >> ProjTable(ProjId) >> PurchReqTable(ProjId).

    Don't look for table relation if there is a related field use those to get the data.

    Thanks,

    Girish S.

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... 555 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 364

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans