Multiple Return Line Registration


I have one requirement to register multiple return order at a time.So whenever I will select multiple line from Return table form & click on Registration button from Update line those selected lines should come to the Inventtrans Register Form.For that I am passing the recids(SalesLine) of the selected records from Return Table to InventTrans Register Form & in init method I am looping the InventtransOrigin_Ds.executeQuery.But still only one record it is taking into the second Form.

[Sales & Marketing>All Return Orders>Edit>select multiple line>click button Update Line>>Registration>select one Disposition Code]

Any one have any idea to solve this problem???

What do you mean by “looping the InventtransOrigin_Ds.executeQuery”?. It sounds suspicious. Could you show us your code?

Also there may be a dynamic link between both forms.

Nevertheless I don’t see why to bother with RecIds - I would get the active record from args.record(), get the related form data source (dataSource()) and use MultiSelectHelper class to get all selected records.

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();


_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…

Thank u…

Please see the following:

SalesLine line = element.args().record();
MultiSelectionHelper selectHelper = MultiSelectionHelper::construct();

if (line.isFormDataSource())

Nevertheless I asked for the code regarding executeQuery(). Calling executeQuery() in a loop is nonsense - add appropriate ranges and let AX to call executeQuery() (once).

In standard TradeorderLine Register & SalesReturnOrderLineRegister two classes are used.But I am directly passing parameter from 1st form to 2nd form