Skip to content

[Event Request] Table 5080 "To-do" - OnProcessAttendeeAppointmentOnAfterFindAttendeeTask #29698

@KlaasKleermaker

Description

@KlaasKleermaker

Why do you need this change?

In 4PS Construct we also create appointments for attendees with "Attendee Type" = Contact.

Describe the request

Dear ALAppExtensions team,

On behalf of 4PS I would like to request integration event 'OnProcessAttendeeAppointmentOnAfterFindAttendeeTask' to be added to procedure ProcessAttendeeAppointment in table 5080 "To-do".

    local procedure ProcessAttendeeAppointment(Task: Record "To-do"; var Attendee: Record Attendee)
    var
        Task2: Record "To-do";
        Salesperson: Record "Salesperson/Purchaser";
        Salesperson2: Record "Salesperson/Purchaser";
        ExchangeWebServicesServer: Codeunit "Exchange Web Services Server";
        Mail: Codeunit Mail;
        Appointment: DotNet IAppointment;
        SalesPersonList: Text;
        Body: Text;
    begin
        if CreateExchangeAppointment then
            InitializeExchangeAppointment(Appointment, ExchangeWebServicesServer);
        repeat
            //if FindAttendeeTask(Task2, Attendee) then //old
            if FindAttendeeTask(Task2, Attendee) then begin //new
                OnProcessAttendeeAppointmentOnAfterFindAttendeeTask(Attendee, Task, Task2, SalesPersonList, CreateExchangeAppointment); //new
                if Attendee."Attendee Type" = Attendee."Attendee Type"::Salesperson then
                    if Salesperson2.Get(Task2."Salesperson Code") and
                       Salesperson.Get(Task."Salesperson Code")
                    then
                        if CreateExchangeAppointment then begin
                            UpdateAppointmentSalesPersonList(SalesPersonList, Salesperson2.Name);
                            if Salesperson2."E-Mail" <> '' then
                                AddAppointmentAttendee(Appointment, Attendee, Salesperson2."E-Mail");
                        end else begin
                            Body := MakeAppointmentBody(Task, Salesperson2.Name, Salesperson.Name);
                            if Mail.NewMessage(Salesperson2."E-Mail", '', '', Task2.Description, Body, '', false) then
                                SetAttendeeInvitationSent(Attendee)
                            else
                                Message(Text023, Attendee."Attendee Name");
                        end
                    else begin
                        LogTaskInteraction(Task, Task2, true);
                        SetAttendeeInvitationSent(Attendee);
                    end;
            end; //new
        until Attendee.Next() = 0;
        if CreateExchangeAppointment and (SalesPersonList <> '') then begin
            Body := MakeAppointmentBody(Task, SalesPersonList, Salesperson.Name);
            Appointment.Body := Body;
            SaveAppointment(Appointment)
        end;
    end;
    [IntegrationEvent(false, false)]
    local procedure OnProcessAttendeeAppointmentOnAfterFindAttendeeTask(var Attendee: Record Attendee; var Task: Record "To-do"; var Task2: Record "To-do"; var SalesPersonList: Text; CreateExchangeAppointment: Boolean)
    begin
        //new
    end;

Internal work item: AB#621712

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions