ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 251 Gen. Product Posting Group - Field 3 - OnValidate - "OnValidateDefVATProdPostingGroupOnBeforeModifyGLAccount", "OnValidateDefVATProdPostingGroupOnBeforeModifyItem"

Open MH1612 opened this issue 4 years ago • 1 comments

Can we please get the following events?

field(3; "Def. VAT Prod. Posting Group"; Code[20])
        {
            trigger OnValidate()
            var
                ConfirmManagement: Codeunit "Confirm Management";
            begin
                if CurrFieldNo = 0 then
                    exit;

                if "Def. VAT Prod. Posting Group" <> xRec."Def. VAT Prod. Posting Group" then begin
                    GLAcc.SetCurrentKey("Gen. Prod. Posting Group");
                    GLAcc.SetRange("Gen. Prod. Posting Group", Code);
                    GLAcc.SetRange("VAT Prod. Posting Group", xRec."Def. VAT Prod. Posting Group");
                    if GLAcc.Find('-') then
                        if ConfirmManagement.GetResponseOrDefault(
                             StrSubstNo(
                               Text000, GLAcc.FieldCaption("VAT Prod. Posting Group"),
                               GLAcc.TableCaption, GLAcc.FieldCaption("Gen. Prod. Posting Group"),
                               Code, xRec."Def. VAT Prod. Posting Group"), true)
                        then
                            repeat
                                GLAcc2 := GLAcc;
                                GLAcc2."VAT Prod. Posting Group" := "Def. VAT Prod. Posting Group";

				OnValidateDefVATProdPostingGroupOnBeforeModifyGLAccount(GLAcc2); <-- NEW EVENT

                                GLAcc2.Modify();
                            until GLAcc.Next() = 0;

                    Item.SetCurrentKey("Gen. Prod. Posting Group");
                    Item.SetRange("Gen. Prod. Posting Group", Code);
                    Item.SetRange("VAT Prod. Posting Group", xRec."Def. VAT Prod. Posting Group");
                    if Item.Find('-') then
                        if ConfirmManagement.GetResponseOrDefault(
                             StrSubstNo(
                               Text000, Item.FieldCaption("VAT Prod. Posting Group"),
                               Item.TableCaption, Item.FieldCaption("Gen. Prod. Posting Group"),
                               Code, xRec."Def. VAT Prod. Posting Group"), true)
                        then
                            repeat
                                Item2 := Item;
                                Item2."VAT Prod. Posting Group" := "Def. VAT Prod. Posting Group";

				OnValidateDefVATProdPostingGroupOnBeforeModifyItem(Item2); <-- NEW EVENT

                                Item2.Modify();
                            until Item.Next() = 0;

  
			...
                end;
            end;
[IntegrationEvent(TRUE, false)]
local procedure OnValidateDefVATProdPostingGroupOnBeforeModifyItem(var Item: Record Item)
    begin    
    end;
[IntegrationEvent(TRUE, false)]
local procedure OnValidateDefVATProdPostingGroupOnBeforeModifyGLAccount(var GLAccount: Record "G/L Account")
    begin
    end;

MH1612 avatar May 05 '22 10:05 MH1612

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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar May 11 '22 16:05 JesperSchulz