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 :
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,122 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,796 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 965 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans