Improvement on Purchase Requisition


We have a function in our system which is used to calculate a requisition worksheet. The issue that we are having is that this routine locks up our system. Since our websolution is using 1 NAS this also locks up for a couple of minutes.

I’m personally convinced that much could be solved by having other routine within the purchase department, but I woul also like to get other opinions.

The report goes through all our items in table 27, today 100287 records.

Any thoughts and opinions would be greatly appriciated.

Item - OnAfterGetRecord()

CALCFIELDS(Inventory,“Qty. on Purch. Order”,“Qty. on Sales Order”,“Return Order (Qty.)”);

AvailQty := Inventory + “Qty. on Purch. Order” +“Return Order (Qty.)” - “Qty. on Sales Order”;
QuantToPurch := “Reorder Point” - AvailQty;

IF QuantToPurch < 0 THEN
QuantToPurch := 0;

IF “Reorder Quantity” <> 0 THEN
QuantToPurch := “Reorder Quantity” * ROUND(QuantToPurch/“Reorder Quantity”,1,’>’);

IF QuantToPurch > 0 THEN
InsertReqLine(“Vendor No.”,QuantToPurch);