Hi,
I am developing a form which has the source table as ‘Despatch Calculation’. This table has a field called ‘Balance to sell’.The items and other fields on this form are updated by selectin the location and date filter on the top of the form. I hav a button in this form to update the ‘Balance to Sell’ field. It has to update this field from the ‘Sales Line’ table. Now it is updating properly only for a single row. But I want to update the same for the entire column at the same time when I click the update button. I have written the followin code on OnPush of the update button… Please can anyone lemme know what is stoppin in my code to update the entire column…
This is the code I have written…
IF NOT CONFIRM(‘Do you want to update the balance to sell ?’) THEN
EXIT;
recDCalc.RESET;
recDCalc.SETRANGE(recDCalc.“Forecast Location”,ForecastLoc);
recDCalc.SETFILTER(recDCalc.“Forecast Date”,’>=%1&<=%2’,“Forecast From”,“Forecast To”);
recDCalc.SETRANGE(recDCalc.“Item No.”,“Item No.”);
IF recDCalc.FIND(’-’) THEN
BEGIN REPEAT
recSL.RESET;
recSL.SETRANGE(recSL.“Document Type”,recSL.“Document Type” :: Order);
recSL.SETRANGE(recSL.“Location Code”,recDCalc.“Forecast Location”);
recSL.SETFILTER(recSL.“Shipment Date”,’>=%1&<=%2’,“Forecast From”,“Forecast To”);
recSL.SETRANGE(recSL.“No.”,recDCalc.“Item No.”);
IF recSL.FIND(’-’) THEN
REPEAT
recDCalc.“Balance to Sell” += recSL.“Outstanding Quantity”;
UNTIL recSL.NEXT = 0;
recDCalc.MODIFY;
UNTIL recDCalc.NEXT = 0;
END;