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

How to make a relation between view and table in form

(0) ShareShare
ReportReport
Posted on by 148

pastedimage1642507295730v1.png

here custtable is table and apnttaxregistrationview is a view, how to give relation between these two ?

thanks in advance.

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Prasanth,

    You can add the relation in the form init method. You can use code like this -

    QueryBuildDataSource    CustTableDs;
    
    CustTableDs = CustTable_ds.query().dataSourceTable(tableNum(CustTable));
    CustTableDs.addLink(fieldNum(CustTable, CustAccount), fieldNum(ApntTaxRegistrationView, CustAccount));

    You can use the fields based on which you want to to relate CustTable and the view.

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    It's true that it needs to be added in code with the help of addLink(), but the implementation above isn't correct - the order of fields in addLink() should be reversed.

    Also, you said that they should have a relation, but you didn't say which one should be the parent. Maybe you need to add a link to ApntTaxRegistrationView instead of CustTable.

    And by the way, custTable_ds.query().dataSourceTable(tableNum(CustTable)) can be replaced with mere custTable_ds.queryBuildDataSource(). And if you put it into init() of the data source, it'll be this.queryBuildDataSource().

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 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans