Skip to content

[Event Requet] Table 23 "Vendor".ShowContact #29818

@fridrichovsky

Description

@fridrichovsky

Why do you need this change?

We need change securityfiltering to ignore before this function because it generated unwanted error to users.

Describe the request

procedure ShowContact()
    var
        Cont: Record Contact;
        OfficeContact: Record Contact;
        ContBusRel: Record "Contact Business Relation";
        ConfirmManagement: Codeunit "Confirm Management";
        OfficeMgt: Codeunit "Office Management";
        ShouldExit: Boolean;
        ContactPageID: Integer;
    begin
        //-------------------------------------OnBeforeShowContact:BEGIN
        OnBeforeShowContact(Rec);
        //-------------------------------------OnBeforeShowContact:END
        if OfficeMgt.GetContact(OfficeContact, "No.") and (OfficeContact.Count = 1) then begin
            ContactPageID := PAGE::"Contact Card";
            OnShowContactOnBeforeOpenContactCard(OfficeContact, ContactPageID);
            PAGE.Run(ContactPageID, OfficeContact);
        end else begin
            ShouldExit := "No." = '';
            OnShowContactOnAfterCalcShouldExit(Rec, ContactPageID, ShouldExit);
            if ShouldExit then
                exit;

            ContBusRel.SetCurrentKey("Link to Table", "No.");
            ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Vendor);
            ContBusRel.SetRange("No.", "No.");
            if not ContBusRel.FindFirst() then begin
                if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text003, TableCaption(), "No."), true) then
                    exit;
                UpdateContFromVend.InsertNewContact(Rec, false);
                ContBusRel.FindFirst();
            end;
            Commit();

            Cont.FilterGroup(2);
            Cont.SetRange("Company No.", ContBusRel."Contact No.");
            COntactPageID := PAGE::"Contact List";
            OnShowContactOnBeforeOpenContactList(Cont, ContactPageID);
            PAGE.Run(ContactPageID, Cont);
        end;
    end;

    //-------------------------------------OnBeforeShowContact:BEGIN
    [IntegrationEvent(false, false)]
    local procedure OnBeforeShowContact(var Vendor: Record Vendor)
    begin
    end;
    //-------------------------------------OnBeforeShowContact:END

Internal work item: AB#624784

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions