I am trying to filter the value of General business posting group based on the value of General product posting group in item journal which is setup in General posting setup.
I have tried many codes like down below but it doesn't seem to filter the values.
TableRelation = "Gen. Business Posting Group".Code where ("Gen. Product Posting Group" = field("Gen. Prod. Posting Group"));
or
TableRelation = "General Posting Setup"."Gen. Bus. Posting Group" where ("Gen. Prod. Posting Group" = field("Gen. Prod. Posting Group"));
or
trigger OnLookup(Text : Text) : Boolean;
var
postsetup : Record "General posting Setup";
Busgroup : Record "Gen. Business Posting Group";
begin
postsetup.Reset();
Busgroup.Reset();
postsetup.SetRange("Gen. Prod. Posting Group", Rec."Gen. Prod. Posting Group");
if postsetup.FindFirst then begin
Busgroup.SetRange("Code",postsetup."Gen. Bus. Posting Group");
if Page.RunModal(PAGE::"Gen. Business Posting Groups",Busgroup) = ACTION::LookupOK then begin
Rec."Gen. Prod. Posting Group" := Busgroup.Code;
end;
end;
end;

Report
All responses (
Answers (