web
You’re offline. This is a read only version of the page.
close
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 ;)

I have the same question (0)
  • Suggested answer
    Greg Enns Profile Picture
    1,106 on at

    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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans