Dear Experts,
I am trying to create an SP, which would do the following:
1.) User opens Item Master Data window and tries to modify the ItemGroup field on an existing Item
2.) If Item has any quantity OnHand, in any Inventory, then SP blocks the modification
3.) SP sends an error message: "ItemGroup value cannot be modified on stock Item"
I have tried with this, but it is blocking any modification for item with stock value, not only for ItemGroup field:
IF @object_type = '4' AND @transaction_type ='U'
BEGIN
if EXISTS (select T0.ItmsGrpCod from OITM T0
where (T0.OnHand>0) and T0.ItemCode=@list_of_cols_val_tab_del)
begin
select @error = -1
select @error_message= 'ItemGroup value cannot be modified on stock Item'
end
END
Thank you for your help in advance,
Balazs