Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Dialog lookup

Posted on by 570

Hello Martin!

I have a doubt, I made a table and I want to show its columns in a lookup, but what should I put in dialog.addField () ?, I do not have any extended fields.

My fields are:

IdRute (Int)

Location (String)
Description (String)

I like show Location and Description, my lookup class is:

public Common Entrega_Lookup(FormReferenceControl _control)
{
    SysReferenceTableLookup  tableLookup = SysReferenceTableLookup::newParameters(tableNum(EntregaMercancia), _control);
    Query query = new Query();
    QueryBuildDataSource qbds = query.addDataSource(tableNum(EntregaMercancia));

    tableLookup.parmQuery(query);
    tableLookup.addLookupfield(fieldNum(EntregaMercancia, Location));
    tableLookup.addLookupfield(fieldNum(EntregaMercancia, Descripcion));

    return tableLookup.performFormLookup();
}


And the Job is:

public void _Lookup(Args _args)
{
    Dialog dialog;
    DialogField field1;

    dialog = new Dialog("Location Name");
    field1 = dialog.addField(extendedTypeStr(SalesId));  <-- what should I put here

    field1.registerOverrideMethod(methodstr(FormReferenceControl, lookupReference),
        methodstr(Entrega, Entrega_Lookup),this);

    dialog.run();
}


if I put the extended data of salesid, it brings me salestable columns

Thanks in advance

*This post is locked for comments

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Dialog lookup

    Hi,

    you posted in a 4 year old discussion that was already marked as answered. I separated your question into a new thread.

    About your question, you should use the same data type that you want to return to that field. So in this case please use the same data type that your EntregaMercancia.Location has.

    Is that the field you want to return to the dialog? What about the "IdRute"?

    Anyway you should not use SalesId, unless you want to handle Sales order numbers in this field.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans