Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Table relations by code

(0) ShareShare
ReportReport
Posted on by

Hello all,

I have created a field that has a table relation on the Purchase header. But now it can be that the displayed purchase order is archived and thus the field is emptied.

How can I tell the system to execute one Table Relation for one value and the other Table Relation for the other value, depending on a condition? I want one Table Relation to go to the orders and the other to the order archive,depending on which condition is true?

Thank you ;)

  • Suggested answer
    Greg Enns Profile Picture
    1,102 on at
    RE: Table relations by code

    You would need another field on the current record, to indicate if the Table Relation should be to the PurchaseHeader or PurchaseHeaderArchive. For example, the field could be a boolean called "IsArchived".

    You should be able to follow the pattern used for the "No." field on the PurchaseLine table. The "Type" field is the indicator that adjusts the Table Relation for the "No." field.

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,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,009 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans