In element().args().record() only one record it will take.Not all selected records.So I used below code to get multiple selected records as you mentioned (using MultiselectionHelper Class):
In the Return Table Form clicked method of the Registration button I was passing SalesLine RecIds to the InventtransRegister Form.
SalesLine _salesline;
container con;
str multiselecting;
TradeOrderLineRegister TradeOrderLineRegister;
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
Args args;
Set selectedRecords = new Set(Types::Record);
args = new Args();
selectionHelper.parmDatasource(salesline_ds);
_salesline = selectionHelper.getFirst();
while(_salesline)
{
selectedRecords.add(_salesline);
con = conIns(con,1,_salesline.RecId);
_salesline = selectionHelper.getNext();
}
multiselecting = con2Str(con,’,’);
args.parm(multiselecting);
new MenuFunction(identifierstr(InventTransRegister), MenuItemType::Display).run(args);
In the InventTransRegister Form init method I am taking those selected records RecId.
But In standard it was using element().args().record().So it was taking only one record previously.
My thinking is to get multiple records in the InventTransOrigin Form I have to pass multiple InventTransOrigin Recids to the InventTransOriginMovement_ds executequery.But I am unable to pass that.
If there is any other way to get multiple records in the InventTransOrigin Form please let me know…
Thank u…