Hello All,
I have one customization to be achieved where in the purchase line only the item with same vat. prod. posting group are to be allowed to insert.I have partially achieved the customization so far.The only problem I am facing is when I am inserting the item no. in second line it does not get validated and other fields are not populated automatically.I wrote the code in purchase order subform(50) page in the no. validate trigger and I called the function in that code.Following is the code I wrote:-
PurchLine := Rec;
IF Type = Type::Item THEN
CompareVatProdPostingGr(PurchLine);
CompareVatProdPostingGr(PurchLine); is the function I added.It has the following code:-
Item.RESET;
SETRANGE("Document Type","Document Type"::Order);
SETRANGE("Document No.","Document No.");
IF FINDFIRST THEN BEGIN
Item.SETRANGE("No.","No.");
IF Item.FINDFIRST THEN BEGIN
IF Item."VAT Prod. Posting Group" <> PurchaseLine."VAT Prod. Posting Group" THEN
ERROR(Text002);
END;
END;
I would really appreciate the help.I have been trying to figure it out for week.But getting no where.
*This post is locked for comments
I have the same question (0)