on validating quantity in sales line a error message should be pop if the item is blocked on item card
modify(Quantity)
{
trigger OnAfterValidate()
var
ItemS: Record Item;
SaleslineS: RECORD "Sales Line";
TEXT2: Label 'This item is blocked %1 ';
begin
IF rec.Type = Enum::"Sales Line Type"::Item then
if ItemS.Get(REC."No.") then
if ItemS.Blocked = true then begin
Error(TEXT2, ItemS."No.");
end;
end;
}
how to modify this code