Hello All,
I have the below procedure and it needs to be called from Customer Card, Contact Card and Vendor Card. Currently it is written for all the 3 pages separately. Requirement is to make it centralized and only function call should be there in the corresponding page. How can I modify it, please suggest !!
Many thanks....
Below is the code :--
procedure RightToAccessExportDataXML(Rec: Record Customer)
var
GDPRSpecificHierarchyTypeRec: Record "GDPRSpecificHierarchyType";
GDPRSpecificHierarchyRec: Record "GDPR Specific Hierarchy";
GDPRSetupRec: Record "GDPR Setup";
GDPRSpecificHierarchyTypes: Page "GDPR Specific Hierarchies";
GDPRRightToAccess: Codeunit "GDPR Functions";
begin
GDPRSetupRec.Get();
if GDPRSetupRec."Open Hierarchy List" then begin
GDPRSpecificHierarchyTypeRec.FilterGroup(2);
GDPRSpecificHierarchyTypeRec.SetRange("Data Subject Group", GDPRSpecificHierarchyTypeRec."Data Subject Group"::Customer);
GDPRSpecificHierarchyTypeRec.FilterGroup(0);
GDPRSpecificHierarchyTypes.SetRecord(GDPRSpecificHierarchyTypeRec);
GDPRSpecificHierarchyTypes.SetTableView(GDPRSpecificHierarchyTypeRec);
GDPRSpecificHierarchyTypes.LookupMode(true);
GDPRSpecificHierarchyTypes.Editable(false);
if (GDPRSpecificHierarchyTypes.RunModal = ACTION::LookupOK) then begin
GDPRSpecificHierarchyTypes.GetRecord(GDPRSpecificHierarchyTypeRec);
GDPRSpecificHierarchyRec.SetRange("Parent Entry No.", 0);
GDPRSpecificHierarchyRec.SetRange("Hierarchy Type Code", GDPRSpecificHierarchyTypeRec.Code);
GDPRSpecificHierarchyRec.FindFirst();
GDPRRightToAccess.AccessExportSpecificHierarchy(Rec."No.", GDPRSpecificHierarchyRec."Entry No.", GDPRSpecificHierarchyTypeRec.Code);
end;
end else
GDPRRightToAccess.AccessDefaultCustomerData(Rec."No.");
end;