How can I control the stock out level , when I posting an order.
Exactly, if stock level is negative, show an alert when I click F11. Where should I write the code, which codeunit and what is the code ???
Pls hlp .. :-k
If you put an ERROR with the inventory check in Codeunit 21 - OnRun, it will be sure that you will never have negative inventory.
Something like this:
Item.GET("Item No.");
Item.SETFILTER("Location Filter","Location Code");
Item.SETFILTER("Variant Filter","Variant Code");
Item.Calcfields("Inventory");
IF item.Inventory<=0 then begin
error(text500);
end;
Do It Yourself is they key. Standard code might work - your code surely works.
Comments
Something like this:
Item.GET("Item No.");
Item.SETFILTER("Location Filter","Location Code");
Item.SETFILTER("Variant Filter","Variant Code");
Item.Calcfields("Inventory");
IF item.Inventory<=0 then begin
error(text500);
end;
Do It Yourself is they key. Standard code might work - your code surely works.