Thanks, but what I have exactly to change to block selling of the excess quantity that I don't have in my inventory?
WITH ItemJnlLine DO BEGIN
IF ItemLedgEntry.Open THEN BEGIN
IF (((ItemLedgEntry."Entry Type" IN
[ItemLedgEntry."Entry Type"::"Negative Adjmt.",
ItemLedgEntry."Entry Type"::Consumption]) AND
("Source Type" = "Source Type"::Item)) OR
(ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
(ItemLedgEntry.Quantity < 0)
THEN
ERROR(Text005,ItemLedgEntry."Item No.");
Comments
There you have it.
Thange that if statement just the way you like it.
If it was hard to write, it should be hard to understand."
WITH ItemJnlLine DO BEGIN
IF ItemLedgEntry.Open THEN BEGIN
IF (((ItemLedgEntry."Entry Type" IN
[ItemLedgEntry."Entry Type"::"Negative Adjmt.",
ItemLedgEntry."Entry Type"::Consumption]) AND
("Source Type" = "Source Type"::Item)) OR
(ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
(ItemLedgEntry.Quantity < 0)
THEN
ERROR(Text005,ItemLedgEntry."Item No.");
* Please test carefully!
If it was hard to write, it should be hard to understand."