Hi,
I'm trying to extend SAFT Report by a multi select lookup parameter. I did add a list in extended contract class, yet the lookup shows with no options to pick.
What is might be the problem here?
[
DataContractAttribute,
SysOperationContractProcessingAttribute(classStr(SAFTReportSZMUI))
]
[ExtensionOf(classStr(SAFTReportContract_Base_W))]
final class SAFTReportContract_Base_W_SZM_Extension
{
private NoYes selectedWH;
private List multiLocationId;
[
DataMember('Czy zakolejkować magazyny?'),
SysOperationGroupMember('Warehouse'),
SysOperationDisplayOrder('2')
]
public NoYes parmSelectedWarehouses(NoYes _selectedWH = selectedWH)
{
selectedWH = _selectedWH;
return selectedWH;
}
[
DataMember('WarehouseMultiselect'),
SysOperationGroupMember('Warehouse'),
SysOperationDisplayOrder('3'),
AifCollectionType('WarehouseMultiselect', Types::String, extendedTypeStr(InventLocationId))
]
public List parmInventLocationIdMulti(List _multiLocationId = multiLocationId)
{
multiLocationId = _multiLocationId;
return multiLocationId;
}
}
class SAFTReportSZMUI extends SysOperationAutomaticUIBuilder
{
FormStringControl custGroupRecIdsControl;
#define.InventLocationIdName('InventLocationIdControl')
public void postRun()
{
SysOperationDialog reportDialog;
reportDialog = this.dialog();
custGroupRecIdsControl = dialog.formRun().design().addControl(FormControlType::String, #InventLocationIdName);
custGroupRecIdsControl.visible(false);
}
public void build()
{
SAFTReportContract_Base_W contract;
DialogField dialogField;
contract = this.dataContractObject() as SAFTReportContract_Base_W;
dialogField = this.addDialogField(methodStr(SAFTReportContract_Base_W, parmInventLocationIdMulti), contract);
}
public void postBuild()
{
DialogField dialogField;
SAFTReportContract_Base_W contract;
;
super ();
contract = this.dataContractObject();
dialogField = this.bindInfo().getDialogField(this.dataContractObject(), methodstr(SAFTReportContract_Base_W, parmInventLocationIdMulti));
dialogField.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(SAFTReportSZMUI, custGroupIdLookup), this);
}
protected void custGroupIdLookup(FormStringControl _control)
{
Query query;
QueryBuildDataSource qbds;
SysLookupMultiSelectGrid lookup;
container selectedFields;
query = new Query();
qbds = query.addDataSource(tableNum(InventLocation));
qbds.addSelectionField(fieldNum(InventLocation, InventLocationId));
qbds.addSelectionField(fieldNum(InventLocation, Name));
qbds.addSelectionField(fieldNum(InventLocation, InventSiteId));
selectedFields = [tableNum(InventLocation), fieldNum(InventLocation, InventLocationId)];
lookup = new SysLookupMultiSelectGrid();
lookup.parmCallingControlStr(_control);
lookup.parmCallingControl(_control);
// lookup.parmCallingControlId(custGroupRecIdsControl);
lookup.parmSelectField(selectedFields);
lookup.parmQuery(query);
lookup.run();
}
}