SBX - Search With Button

SBX - Forum Post Title

Dialog lookup

Microsoft Dynamics AX Forum

ismaelivan asked a question on 15 May 2019 10:11 AM
My Badges

Question Status

Suggested Answer

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

Reply
Suggested Answer

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.

Reply
Suggested Answer

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.

Reply

SBX - Two Col Forum

SBX - Migrated JS