ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 250 Gen. Business Posting Group - Field 3 - OnValidate "OnValidateDefVATBusPostingGroupOnBeforeModifyGLAccount"

Open MH1612 opened this issue 4 years ago • 1 comments

Can we please get the following event?

field(3; "Def. VAT Bus. Posting Group"; Code[20])
{
	Caption = 'Def. VAT Bus. Posting Group';
	TableRelation = "VAT Business Posting Group";

	trigger OnValidate()
	begin
		if "Def. VAT Bus. Posting Group" <> xRec."Def. VAT Bus. Posting Group" then begin
			GLAcc.SetCurrentKey("Gen. Bus. Posting Group");
			GLAcc.SetRange("Gen. Bus. Posting Group", Code);
			GLAcc.SetRange("VAT Bus. Posting Group", xRec."Def. VAT Bus. Posting Group");
			if GLAcc.Find('-') then
				repeat
					GLAcc2 := GLAcc;
					GLAcc2."VAT Bus. Posting Group" := "Def. VAT Bus. Posting Group";

					OnValidateDefVATBusPostingGroupOnBeforeModifyGLAccount(GLAcc2); <-- NEW EVENT

					GLAcc2.Modify;
				until GLAcc.Next = 0;

			Cust.SetCurrentKey("Gen. Bus. Posting Group");
			Cust.SetRange("Gen. Bus. Posting Group", Code);
			Cust.SetRange("VAT Bus. Posting Group", xRec."Def. VAT Bus. Posting Group");
			if Cust.Find('-') then
				repeat
					Cust2 := Cust;
					Cust2."VAT Bus. Posting Group" := "Def. VAT Bus. Posting Group";
					Cust2.Modify;
				until Cust.Next = 0;

			Vend.SetCurrentKey("Gen. Bus. Posting Group");
			Vend.SetRange("Gen. Bus. Posting Group", Code);
			Vend.SetRange("VAT Bus. Posting Group", xRec."Def. VAT Bus. Posting Group");
			if Vend.Find('-') then
				repeat
					Vend2 := Vend;
					Vend2."VAT Bus. Posting Group" := "Def. VAT Bus. Posting Group";
					Vend2.Modify;
				until Vend.Next = 0;
		end;
	end;
}
[IntegrationEvent(TRUE, false)]
local procedure OnValidateDefVATBusPostingGroupOnBeforeModifyGLAccount(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 12 '22 05:05 JesperSchulz