Skip to main content

Notifications

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

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Reference Group Field Lookup values from Multiple tables

    Thankyou Ievgen.

    Thank you somuch

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Reference Group Field Lookup values from Multiple tables

    Yes,

    you are correct.

    Using view and overriding lookup ref will do.

    I will update entire steps.

  • Verified answer
    Mea_ Profile Picture
    60,278 on at
    RE: Reference Group Field Lookup values from Multiple tables

    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
    RE: Reference Group Field Lookup values from Multiple tables

    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.

  • Mea_ Profile Picture
    60,278 on at
    RE: Reference Group Field Lookup values from Multiple tables

    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
    RE: Reference Group Field Lookup values from Multiple tables

    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,278 on at
    RE: Reference Group Field Lookup values from Multiple tables

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

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Reference Group Field Lookup values from Multiple tables

    Please reply

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Reference Group Field Lookup values from Multiple tables

    Experts please give some clue

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Reference Group Field Lookup values from Multiple tables

    Experts please reply

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 50

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Featured topics

Product updates

Dynamics 365 release plans