Wednesday 24 May 2017

Select multiple values in lookup in a dropdialog

Use SysLookupMultiSelectCtrl

declare SysLookupMultiSelectCtrl        multiSelectCtrl;

in init method of form write the following code

Query query = new Query();
    QueryBuildDataSource qbds;

    super();

    qbds = query.addDataSource(tableNum(Table));
    qbds.fields().addField(fieldNum(Table,Field));

    multiSelectCtrl = SysLookupMultiSelectCtrl::constructWithQuery(element, ControlName, query);

make control propery auto declartion to Yes.

To Get the values use the below code as per your requirement.

    int                          i;
    container                   values;
    int64                         IdLoc;
    values = multiSelectCtrl.get(); to get the selected values from lookup
    for(i=1; i<=conLen(values) ; i++)
    {
        IdLoc = conPeek(values,i);
        info("IdLoc ");
}

     



No comments:

Post a Comment