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 :
Microsoft Dynamics AX (Archived)
Answered

Reference Group Field Lookup values from Multiple tables

(0) ShareShare
ReportReport
Posted on by 2,426

Good Morning.

I have one field of type int 64 and having relation with cust invoice jour table.

i have added that to Form Design as reference group.

Now i need lookup from 2 tables.No filter required.

I have agged join in query and Added to Syslookupfield.addfield(2nd table field).

Then in lookup i am getting None.

How can i solve this.

Please show some ligt on this.

Regards.

Have a great day.

*This post is locked for comments

I have the same question (0)
  • AX 2012 r3 Profile Picture
    2,426 on at

    Experts please reply

  • AX 2012 r3 Profile Picture
    2,426 on at

    Experts please give some clue

  • AX 2012 r3 Profile Picture
    2,426 on at

    Please reply

  • Mea_ Profile Picture
    60,284 on at

    What do you mean under "lookup from 2 tables"?

  • AX 2012 r3 Profile Picture
    2,426 on at

    Hi Ievgen,

    Thank you so much for your reply.

    What happened is.

    1.Create one int64 field

    2.Added relation with Custinvoicejour recid.

    3.Added in form (step - 1) field as reference group field.

    4.In lookup i want 4 fields from custinvoice jour and 1 field from salestable.

    5.I overide lookup() not getting any changes.

    6.i override Lookupreference() and here i am taling about .

    how to get another table field.(4th field from salestable)

    i have linked query with both custinvoicejour and salestable and

    then i used in syslookup.addfield(here i placed salestable field).

    I am getting none as 4th column in lookup.

    Please show some light on this.

    Regards.

    Have a great day.

  • Mea_ Profile Picture
    60,284 on at

    Do you use SysReferenceTableLookup class?

    It makes sense to share your code so we can help to find the issue

  • AX 2012 r3 Profile Picture
    2,426 on at

    Hi ,

    public Common lookupReference(FormReferenceControl _formReferenceControl)
    {
    Common ret;
    Query query = new Query();
    QueryBuildDataSource qbds, qbdssalestable;
    SysReferenceTableLookup sysTableLookup;
    ;

    sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(CustInvoiceJour), _formReferenceControl);
    qbds = query.addDataSource(tableNum(CustInvoiceJour));

    qbdssalestable = qbds.addDataSource(tableNum(SalesTable));
    qbdssalestable.relations(false);
    qbdssalestable.addLink(fieldNum(CustInvoiceJour,SalesId),fieldNum(SalesTable,SalesId));
    qbdssalestable.joinMode(JoinMode::OuterJoin);

    sysTableLookup.addLookupfield(fieldNum(CustInvoiceJour, Invoiceid));
    sysTableLookup.addLookupfield(fieldNum(CustInvoiceJour, InvoiceDate));
    sysTableLookup.addLookupfield(fieldNum(SalesTable, SalesId));
    sysTableLookup.parmQuery(query);

    return sysTableLookup.performFormLookup();
    }

    1_5F00_004.png

    getting unknown for the salestable custgroup field.

    Not for custgroup the field to be added is our own customized field in salestable.

    The custgroup is an example.

    Please show some light on this.

    Regards.

    Have a great day.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    So you cannot use 2 data sources  with SysReferenceTableLookup, easiest way is to use view that has tables joined as datasource instead of building query in the runtime. Another option is to use display method instead of actual field. 

  • AX 2012 r3 Profile Picture
    2,426 on at

    Yes,

    you are correct.

    Using view and overriding lookup ref will do.

    I will update entire steps.

  • AX 2012 r3 Profile Picture
    2,426 on at

    Thankyou Ievgen.

    Thank you somuch

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans