Adding multiple vendors on RFQ form through a multiselect form

The form opens as below: Below is the logic for the ok click : void clicked() { MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();//Create instance of class Set selectedRecords = new Set(Types::Record);//Declare a set of type record VendTable vendTableLocal; //Your table buffer Args args = new Args(); super(); selectionHelper.parmDataSource(VendTable_DS); //Set the datasource vendTableLocal = selectionHelper.getFirst(); //assign to table buffer the reference to selected record(s) if (vendTableLocal.RecId) { while (vendTableLocal) { ...