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, ...
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

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    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

  • Microsoft Dynamics AX 2009 Profile Picture
    5 on at

    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

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

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans