Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

AX 2009: form with multi data sources

(0) ShareShare
ReportReport
Posted on by 5

Hi everybody,

It's the first time that I post in this forum.
I can't resolve a basic issue with three datasource in a form.

DS1  Inventtrans is joined with DS2  WMSJournalTrans (with innerjoin mode by properties and using native links between tables)

DS2 WMSJournalTrans is joined with DS3 WMSJournalTable (with innerjoin mode by properties and using native links between tables)

How can i add by code (and where can I add this code?) a relation between DS1 InventTrans and DS3 WMSJournalTable to obtain this restriction WMSJournalTable.packingSlip = InventTrans.packingSlipID ?

Actually I wrote In init() method of DS3 WMSJournalTable:

QBDSWMSJournalTable     =   this.query().dataSourceName("WMSJournalTable");
QBR_WMSJournalTable     =   sysquery::findOrCreateRange(QBDSWMSJournalTable, fieldnum(WMSJournalTable, packingSlip));
QBR_WMSJournalTable.value(strfmt('%1.packingSlipID', inventTrans_ds.name()));

The result Query lokks like:

SELECT FIRSTFAST * FROM InventTrans WHERE ((TransType = 3)) AND InventTable.ItemId=InventTrans.ItemId

JOIN FIRSTFAST * FROM WMSJournalTrans WHERE InventTrans.InventTransId = WMSJournalTrans.inventTransId

JOIN FIRSTFAST * FROM WMSJournalTable WHERE WMSJournalTrans.journalId = WMSJournalTable.journalId AND ((packingSlip = N'inventtrans.packingSlipID'))

(in blue) It seem to be correct but there's no result in grid.
This query give me results in SQLServer.

Thanks a lot for support.

Regards

  • Microsoft Dynamics AX 2009 Profile Picture
    5 on at
    RE: AX 2009: form with multi data sources

    Hi Sergei and thanks for your support.

    It works.

    I've already used addlink() with no success because I wasn't writing the third parameter (DataSource Parent).

    With this third parameter (optional) : it works!

    Many thanks

    .

    BR

    Christophe

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: AX 2009: form with multi data sources

    Hi Microsoft Dynamics AX 2009,

    The code provided by you adds range (filter) by the field with value N'inventtrans.packingSlipID'. If you want to add the link, you need to use the method addLink on QueryBuildDataSource object.

    docs.microsoft.com/.../querybuilddatasource-class

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,274 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,939 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans