Requirement
Multi Select Lookup Of Warehouse In Form Grid.
Sample Code
- Create a new Class AcxSysLookupMultiSelectGrid & extend it from SysLookupMultiSelectGrid.class AcxSysLookupMultiSelectGrid extends SysLookupMultiSelectGrid
{
#Characters
public void setSelected()
{
dictfield dictField;
Common currentDSRecord;
FormDataSource formdatasource;
callingControlId.text(SysOperationHelper::convertMultiSelectedValueString(selectedId));
formdatasource = callingControlId.dataSourceObject();
if(formdatasource && callingControlStr.dataField())
{
dictfield = new dictfield(formdatasource.table(),callingControlStr.dataField());
currentDSRecord = formdatasource.cursor();
currentDSRecord.(dictfield.id()) = currentDSRecord.(dictfield.id()) + SysOperationHelper::convertMultiSelectedValueString(selectedStr);
callingControlStr.update();
}
else
{
callingControlStr.text(SysOperationHelper::convertMultiSelectedValueString(selectedStr));
}
}public static AcxSysLookupMultiSelectGrid construct(FormControl _ctrlId,
FormControl _ctrlStr)
{
AcxSysLookupMultiSelectGrid lookupMS;
lookupMS = new AcxSysLookupMultiSelectGrid ();
lookupMS.parmCallingControlId(_ctrlId);
lookupMS.parmCallingControlStr(_ctrlStr);
return lookupMS;
}}
- Override the Lookup() method of form control.
public void lookup() {
AcxUserSetup.InventlocationMulti = ”;
multiSelectGrid = AcxSysLookupMultiSelectGrid ::construct(AcxUserSetup_InventlocationMulti,AcxUserSetup_InventlocationMulti);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = query.addDataSource(tableNum(InventLocation));
queryBuildDataSource.addSelectionField(fieldNum(InventLocation, InventLocationId));
queryBuildDataSource.addSelectionField(fieldNum(InventLocation, Name));
multiSelectGrid.parmQuery(query);
multiSelectGrid.parmCallingControl(this);
multiSelectGrid.run();//super();
}
Hi Peeyush,
I have a similar requirement, sorry to say that, but the code you have mentioned here is not working appropriately. Can you please help me with the complete code to achieve this functionality?