How to pass Multi arguments/ parameter to SSRS Controller RDP D365 Fo[X++]
1- Make menu item accept multi select.
2- Create menu item, which calls BarcodeController Class.
public class BarcodeController extends SrsReportRunController
{
public static BarcodeController construct()
{
return new BarcodeController ();
}
public static void main(Args _args)
{
GCCLAB_BarcodeController controller =new
GCCLAB_BarcodeController();
GCCLAB_BarcodeContract contract = new GCCLAB_BarcodeContract ();
List fieldList = new List(Types::String);
MultiSelectionHelper multiselectionHelper = MultiSelectionHelper::createFromCaller(_args.caller());
// Get the first record from multiselectionHelper
TableName _tableName = multiselectionHelper.getFirst();
// Check if there is a record to process
while (_tableName )
{
// Add data to a list. Here they use a list of records, but you can also use a list of primitive values (such as record IDs).
fieldList.addEnd(_tableName.Field);
// Get the next selected record
_tableName= multiselectionHelper.getNext();
}
contract.parmFieldList(fieldList);
controller.parmArgs(_args);
controller.parmReportName(ssrsReportStr(BarcodeReport, Design));
controller.parmReportContract().parmRdpContract(contract);
controller.parmShowDialog(false);
controller.parmDialogCaption( strFmt("Generating Barcode"));
controller.startOperation();
}
}