I am having a custom action on 2 different pages. 'event card' and 'event template', and on both actions the same page are getting opened (Eventcat.print) and on the template page, the template no and type will come automatically. if I add the same template no in the event card. I am trying to copy all the records ie the 'type' and the 'template no.' into the event card., and now the template number and type are coming, but I have a 3-column code. in 'Event cat.print' Page. which is a lookup to another table(category print) and the user manually selects the code, but now I need to copy the 'code' to the event card .based on the event template number.
action("Event Cat. Print") { Caption = 'Event Cat. Print'; ApplicationArea = all; Image = Accounts; trigger OnAction() var Eventcategoryprint3: Record "Event Cat. Print" temporary; Categoryprint: Record "Category Print"; begin Eventcategoryprint3.Reset(); Eventcategoryprint3.SetRange(No, REC."No."); if not Eventcategoryprint3.FindFirst() then begin Message('no'); Eventcategoryprint3.Init(); Eventcategoryprint3.Type := Eventcategoryprint3.Type::"Event"; Eventcategoryprint3.No := rec."No."; Eventcategoryprint3.code := Eventcategoryprint3.code; Eventcategoryprint3.Insert(); end; if rec."Template No." <> '' then begin Message('yes'); Eventcategoryprint3.Reset(); Eventcategoryprint3.SetRange(No, Rec."Template No."); if not Eventcategoryprint3.FindFirst() then begin Categoryprint.Reset(); Categoryprint.SetRange(code, Eventcategoryprint3.No); IF not Categoryprint.FindFirst() THEN begin Message('categoryprint%1', Categoryprint.code); Eventcategoryprint3.Init(); Eventcategoryprint3.Type := Eventcategoryprint3.Type::Template; Eventcategoryprint3.No := rec."Template No."; Eventcategoryprint3.code := Categoryprint.code; Eventcategoryprint3.Insert(); end; end; end; Eventcategoryprint3.Reset(); page.Run(50001, Eventcategoryprint3);// end;
I am looking for a result like these but in my case 'code' [ A, B is blank