As we know,when we insert a sales line, “Qty. to ship” will be defautly set as same as the value of “Quantity”.Now I want to set “Qty. to ship” as zero when the field of “Quantity” is insert or modified. How should I do it in Navision 3.01B? I try to modify some code according to the below,but it failed. any other good idea? thanks in advance. Table 37 sales line–>function InitQtytoShip original code: “Qty. to Ship” := “Outstanding Quantity”; “Qty. to Ship (Base)” := “Outstanding Qty. (Base)”; InitQtyToInvoice; modified code: “Qty. to Ship” := 0; “Qty. to Ship (Base)” := 0; InitQtyToInvoice; yes, e.g. when the quantity is input as 10, “qty. to ship” and “qty. to invoice” will be zero. but after that, when I input 10 in “Qty to ship”, “qty to ship” will be changed to 0 for the modified code.Though other value of less than 10 is input, it is ok. If possible, besides the above requirement,I also want to keep their relation when sales order is made from quotes. Is it possible?
Search for ‘InitQtytoShip’, and you will discover all the places from where it is called. You could change the code a bit, maybe: if CURRFIELDNO <> FIELDNO("Qty. to ship") THEN BEGIN "Qty. to Ship" := 0; "Qty. to Ship (Base)" := 0; END; InitQtyToInvoice;
Hi Henrik, Your suggestion works perfectly. Thank you very much!
You could also try changing the original code: "Qty. to Ship" := "Outstanding Quantity"; "Qty. to Ship (Base)" := "Outstanding Qty. (Base)";
To this: //"Qty. to Ship" := "Outstanding Quantity"; //"Qty. to Ship (Base)" := "Outstanding Qty. (Base)";
That way you just leave the field alone and it will never be set by the system.