Skip to main content

Notifications

Announcements

No record found.

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 140

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.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,816 Super User 2024 Season 1 on at
    RE: Get ProjId for those the purchase requisition has been created using x++ code in D365fo

    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.

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Get ProjId for those the purchase requisition has been created using x++ code in D365fo

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

  • Verified answer
    GirishS Profile Picture
    GirishS 27,816 Super User 2024 Season 1 on at
    RE: Get ProjId for those the purchase requisition has been created using x++ code in D365fo

    You can use ProjId field in ProjControlPeriodTable right?

    Thanks,

    Girish S.

  • Sam D. Profile Picture
    Sam D. 140 on at
    RE: Get ProjId for those the purchase requisition has been created using x++ code in D365fo

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

    And From PurchReqTable , there is no direct Relation with ProjControlPeriodTable

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,816 Super User 2024 Season 1 on at
    RE: Get ProjId for those the purchase requisition has been created using x++ code in D365fo

    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.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans