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.
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
Set selectedRecords = new Set(Types::Record);
args = new Args();
_salesline = selectionHelper.getFirst();
con = conIns(con,1,_salesline.RecId);
_salesline = selectionHelper.getNext();
multiselecting = con2Str(con,’,’);
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…