Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Add a datasource and relations at runtime to a view

Posted on by Microsoft Employee

Hi,

I have a form which uses a view as a datasource and I have to add tables to it at runtime. I am trying the following code which is failing could you please suggest what is going wrong?

//qbds.addDataSource(tableNum(InventTable)).addDynalink(fieldNum(ETExtractionView_SAM,ItemId),fieldNum(InventTable,itemid));
        qbds.addDataSource(tableNum(InventTable));
        qbds.addDynalink(fieldNum(ETExtractionView_SAM,ItemId), InventTable, fieldNum(InventTable, itemid));
        qbdsbrand = qbds.addDataSource(tableNum(BrandTable_SAM));
        qbdsbrand.relations(true);
        qbdsbrand.addRange(fieldNum(InventTable,Brand_SAM)).value(brand);


*This post is locked for comments

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Add a datasource and relations at runtime to a view

    Hi Deepak88!

    Can you provide the complete code? And what error did you get?

    Does the InventTable contain Brand_SAM field?

  • Suggested answer
    udaY-ch Profile Picture
    udaY-ch 4,624 on at
    RE: Add a datasource and relations at runtime to a view

    Hi,

    Try following the thread,

    community.dynamics.com/.../157355

    Best,

    Uday.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans