How to show Multiple selected records from one form to another in D365fo x++

How to show Multiple selected records from one form to another

Code: 

public void init() { MultiSelectionHelper multiSelectionHelper; PurchReqLine PurchReqLine_Loc; QueryBuildDataSource qbds; container selectedPR; super(); if (element.args().caller() && element.args().record()) { multiSelectionHelper = MultiSelectionHelper::construct(); multiSelectionHelper.parmDatasource(element.args().record().dataSource()); PurchReqLine_Loc = multiSelectionHelper.getFirst(); while (PurchReqLine_Loc.RecId != 0) { selectedPR += PurchReqLine_Loc.recid; PurchReqLine_Loc = multiSelectionHelper.getNext(); } PurchReqLine_ds.query().dataSourceTable(tableNum(PurchReqLine)).clearDynalinks(); PurchReqLine_ds.query().literals(true); PurchReqLine_ds.query().dataSourceTable(tableNum(PurchReqLine)).addRange(fieldNum(PurchReqLine, RecId)).value(con2StrUnlimited(selectedPR)); } }

Comments

Popular posts from this blog

D365FO – AX – X++ –Refresh, Reread, Research, and ExecuteQuery

Create Inventory Journal through Code in D365FO X++

SalesLine Reservation in D365fo x++