Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

UI Builder lookup

(0) ShareShare
ReportReport
Posted on by 3,945

hi all ,
i am doing SSRS report , i am using UI Builder for lookup of Parameters.
One parameter i having like CustId , in that parameter i need to give id with name , but only CustId is displaying there. I have written this code

public void custIdLookup(FormStringControl _control)
{
    Query                       query = new Query();
    QueryBuildDataSource        qbds;
    container                   conCustId;
    SysTableLookup              stl;
    SysLookupMultiSelect        slms;
    query = new Query(queryStr(OGS_CustomerBackLogReport));
    stl = SysTableLookup::newParameters(tableNum(CustTable),_control);
    stl.addLookupField(fieldNum(CustTable, AccountNum));
    stl.addLookupField(fieldNum(DirPartyTable, Name));
    
    stl.parmQuery(query);
    stl.performFormLookup();
}

Please tell guys whats the problem here.
thanks

*This post is locked for comments

  • Gautam Profile Picture
    Gautam 3,945 on at
    RE: UI Builder lookup

    Thanks its working fine now

  • Verified answer
    syed baber Profile Picture
    syed baber 11,627 on at
    RE: UI Builder lookup

    Hi Gautam,

    You need to join CustTable and DirPartyTable based on the following relation:

    CustTable.Party = DirPartyTable.RecId.

    Take a look at below example which shows how to build the lookup by creating joins between two tables:

    www.axaptapedia.com/SysTableLookup_class

    Please verify and let me know if you have further queries.

    Thanks,

    Baber.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,458 Most Valuable Professional on at
    RE: UI Builder lookup

    Your code s saying: take CustTable and show the field with the same ID as the Name field has in DirPartyTable. I don't know which field in CustTable has such an ID, but it will never display anything from DirPartyTable.

    The easiest solution is using the name() method on CustTable:

    stl.addLookupMethod(tableMethodStr(CustTable, name));

    Alternatively, you could use SysMultiTableLookup.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans