trigger OnAction()
var
ContBusRel: Record /Contact Business Relation/;
Cont: Record Contact;
OfficeContact: Record Contact;
OfficeMgt: Codeunit /Office Management/;
ConfirmManagement: Codeunit /Confirm Management/;
ContactPageID: Integer;
InteractionLog: Record /Interaction Log Entry/;
ContactFilter: text;
begin
rec.ShowContact();
if OfficeMgt.GetContact(OfficeContact, rec./No./) and (OfficeContact.Count = 1) then begin
ContactPageID := PAGE::/Contact Card/;
PAGE.Run(ContactPageID, OfficeContact);
end else begin
if rec./No./ = '' then
exit;
InteractionLog.FilterGroup(-1);
ContBusRel.SetCurrentKey(/Link to Table/, /No./);
ContBusRel.SetRange(/Link to Table/, ContBusRel./Link to Table/::Customer);
ContBusRel.SetRange(/No./, rec./No./);
if ContBusRel.FindSet() then begin
cont.SetRange(/Company No./, ContBusRel./Contact No./);
if cont.FindSet() then
repeat
InteractionLog.SetRange(/Contact No./, cont./No./);
if InteractionLog.FindSet() then
repeat
InteractionLog.Mark(true);
until InteractionLog.Next() = 0;
until cont.next = 0;
end;
InteractionLog.MarkedOnly(true);
InteractionLog.FilterGroup(0);
ContactPageID := PAGE::/Interaction Log Entries/;
PAGE.Run(ContactPageID, InteractionLog);
end;
end;