Here is the sample code to create a multi-select Vendor lookup for the SSRS report.
Create parm method in contract class
Create parm method in contract class
[DataContractAttribute,
SysOperationContractProcessingAttribute(classStr(HRBankPayLetterVendorUIBuilder))]
class HRBankPayLetterVendorContract implements SysOperationValidatable
{
private List vendAccount;
[DataMemberAttribute,
SysOperationLabelAttribute('@HRP:PayrollVendorAccount'),
AifCollectionTypeAttribute('@HRP:PayrollVendorAccount', Types::String),
SysOperationDisplayOrderAttribute('1')]
public List parmVendAccount(List _vendAccount = vendAccount)
{
vendAccount = _vendAccount;
return vendAccount;
}
}
Create UI builder class
class HRBankPayLetterVendorUIBuilder extends SrsReportDataContractUIBuilder
{
private DialogField vendordf;
List vendorList;
HRBankPayLetterVendorContract contract;
public void postBuild()
{
super();
contract = this.dataContractObject();
// binding
dialogs with contract fields
vendordf = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(HRBankPayLetterVendorContract, parmVendAccount));
}
public void postRun()
{
this.lookupVendor();
}
private void lookupVendor()
{
Query query = new Query();
QueryBuildDataSource qbd, qbdPerson;
TableId multiSelectTableNum = tableNum(VendTable);
container selectedFields = [multiSelectTableNum,
fieldName2id(multiSelectTableNum, fieldStr(VendTable, AccountNum))];
qbd = query.addDataSource(tableNum(VendTable));
qbd.addSelectionField(fieldNum(VendTable, AccountNum));
qbd.fields().dynamic(NoYes::No);
qbd.fields().clearFieldList();
qbd.fields().addField(fieldNum(VendTable, AccountNum));
qbd.addRange(fieldNum(VendTable, HRRSPayrollVendor)).value(queryValue(NoYes::Yes));
qbdPerson = qbd.addDataSource(tableNum(DirPartyTable));
qbdPerson.fields().dynamic(NoYes::No);
qbdPerson.fields().clearFieldList();
qbdPerson.fields().addField(fieldNum(DirPartyTable, Name));
qbdPerson.relations(true);
SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(), vendordf.control(), query, false, selectedFields);
}
}
container selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(VendTable, AccountNum))];
ReplyDeletewhat is?
thanks for sharing
ReplyDeleteJust wanna admit that this is invaluable , Thanks for taking your time to write this. Homepage
ReplyDeleteiam new at this i need to put all code in contract class
ReplyDelete