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

Notifications

Announcements

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 150

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,829 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
    150 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,829 Moderator on at

    You can use ProjId field in ProjControlPeriodTable right?

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    150 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,829 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

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... 622 Super User 2025 Season 2

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 438 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 354 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans