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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Can we specify relations on view not table?

(0) ShareShare
ReportReport
Posted on by

Description:

i have a form and datasource is view, the view has parent datasource and child datasource, and also have relation in the child datasource, it will get a invalid datasource error when i filter field and attempt to click lookup form, but if i add the relation in the table, and then add relation in the view, it can work fine. so i want to know that whether can we only specify relation in view not in tables? or we must defined it in table, i couldn't find any document about it. if you know, please tell me why? thanks!

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Apple,

    If tables are related, it is best practice to create the relations on table level. In this way, you can benefit from e.g. auto joins and specify delete actions to set a cascade delete or block deleting a record when there are related records. This to prevent having orphaned records in a database.

  • WillWU Profile Picture
    22,361 on at

    Hi Apple,

    Did you try to use Querybuilddatasource.addLink() to specify relations in X++?

  • Liya Cheng Profile Picture
    on at

    so if we only add relation in view , it didn't work  when we have relation between parent datasource and child datasource in view?

  • Liya Cheng Profile Picture
    on at

    i try to use addlink() in formdatasource, but also couldn't work.

  • WillWU Profile Picture
    22,361 on at

    Hi Apple,

    What do you mean by "not work"?Did you get any error message?

    Please provide your code if possible.

    Thanks.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans