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)

  1. 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

There’s a standard code which does that, I used it before.

You can find it in the class: CustBalanceByDimensionUIBuilder_CN

In the form control

public void lookup()
{
super();
LedgerMatrixReportHelper_CN::dimensionValueLookup(this, “DimensionName”);

}

Thank you Ahmad for immediate reply

But my requirement is multiselect dimenion lookup in report parameters

I know, check the standard way of getting the dimension name and adding it to the lookup in LedgerMatrixReportHelper_CN::dimensionValueLookup and try to use it in your code with the multi selection

Hi Ahmad

DimensionValueLookupHelper::lookupDimensionValues(dimensionAttribute,_ctrl) and LedgerMatrixReportHelper_CN::dimensionValueLookup are same. But how to enable or achieve the multi selection