[IT] Use SetOperationType in VAT Bus. Posting Group validate for Sales/Purchase Header
Hi, we need to handle in one of our custom operation type validation on Sales Header and Purchase Header. The function SetOperationType has all events we need but, as you can see from the code below, in one case system does a direct validation of the field without passing through SetOperationType function.
field(116; "VAT Bus. Posting Group"; Code[20])
{
Caption = 'VAT Bus. Posting Group';
TableRelation = "VAT Business Posting Group";
trigger OnValidate()
var
VATBusinessPostingGroup: Record "VAT Business Posting Group";
begin
TestStatusOpen;
if not CheckVATExemption then
"VAT Bus. Posting Group" := xRec."VAT Bus. Posting Group";
if xRec."VAT Bus. Posting Group" <> "VAT Bus. Posting Group" then
RecreateSalesLines(FieldCaption("VAT Bus. Posting Group"));
VATBusinessPostingGroup.Get("VAT Bus. Posting Group");
_**Validate("Operation Type", VATBusinessPostingGroup."Default Sales Operation Type");**_
end;
}
Thank you
so, do you mean that these two lines: VATBusinessPostingGroup.Get("VAT Bus. Posting Group"); Validate("Operation Type", VATBusinessPostingGroup."Default Sales Operation Type"); should be replaced by one? SetOperationType()
Yes, exactly.
Thank you
Da: Stan Pesotskiy [email protected] Inviato: martedì 27 ottobre 2020 12:32 A: microsoft/ALAppExtensions [email protected] Cc: Alessandro Vecchio [email protected]; Author [email protected] Oggetto: Re: [microsoft/ALAppExtensions] Use SetOperationType in VAT Bus. Posting Group validate for Sales/Purchase Header (#9603)
so, do you mean that these two lines: VATBusinessPostingGroup.Get("VAT Bus. Posting Group"); Validate("Operation Type", VATBusinessPostingGroup."Default Sales Operation Type"); should be replaced by one? SetOperationType()
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/ALAppExtensions/issues/9603#issuecomment-717179767, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALZRTTHSALPCUOIP5E2N7Y3SM2VS7ANCNFSM4TAPT5KA.
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.