How to create dimension lookup(value and name) with multiselect lookup

HI All,

I need to create a multiselect dimension lookup(Value and name).

i have tried the following but didn't get the solution

1.  Using DimensionvalueLookupHelper class i got both the name and value, but multiselect option was not there

     DimensionValueLookupHelper::lookupDimensionValues(dimensionAttribute,_ctrl)

     

2. Using SysLookupMultiSelectCtrl and DimensionAttributeValue table i got the multiselect option but didnt have an option to include a method(getname()/getValue())

     

Query query = new Query();

int mutiSelectTableNum = tablenum(DimensionAttributeValue);
container selectedFields;
query = projectSSRSHelper::Dimension1Lookup(dimensionAttribute);
selectedFields = [mutiSelectTableNum, fieldname2id(mutiSelectTableNum, fieldstr(DimensionAttributeValue, DisplayValue))];
SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(), dimension1.control(), query, false, selectedFields);

class ProjectSSRSHelper
{
      public static Query Dimension1Lookup(dimensionAttribute _dimensionAttribute)
      {
         Query query = new Query();
         QueryBuildDataSource qbds, qbds_join;
         QueryBuildFieldList qbfl;


         qbds = query.addDataSource(tableNum(DimensionAttributeValue));
         qbds.addRange(fieldNum(DimensionAttributeValue, DimensionAttribute)).value(SysQuery::value(_dimensionAttribute.recid));
         qbfl = qbds.fields();
         qbfl.dynamic(false);
         qbfl.clearFieldList();

        qbfl.addField(FieldNum(DimensionAttributeValue,Displayvalue)); 
        qbfl.addField(FieldNum(DimensionAttributeValue,DimensionAttribute));// as we dont a have description/name field. 


        return query;
}

}

is there way to add getname() method of DimensionAttributevalue table as a field list.

can anyone help on this

Related
Recommended