ALAppExtensions
ALAppExtensions copied to clipboard
Table 5080 "To-do" - function InsertTaskAndRelatedData
Hello microsoft/ALAppExtensions,
can you please define following code into a single function:
if Task2."System To-do Type" = "System To-do Type"::Team then begin
TeamSalesperson.SetRange("Team Code", Task2."Team Code");
if TeamSalesperson.Find('-') then
repeat
TempAttendee.CreateAttendee(
TempAttendee,
Task2."No.", 10000,
TempAttendee."Attendance Type"::"To-do Organizer",
TempAttendee."Attendee Type"::Salesperson,
TeamSalesperson."Salesperson Code",
true);
CreateSubTask(TempAttendee, Task2);
TempAttendee.DeleteAll
until TeamSalesperson.Next() = 0
end;
as function name:
CreateOrganizerTask(Task2, TempAttendee);
defining the procedure as:
local procedure CreateOrganizerTask(var Task2: Record "To-do"; var TempAttendee: Record Attendee temporary)
var
TeamSalesperson: Record "Team Salesperson";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeCreateOrganizerTask(Task2, IsHandled);
if IsHandled then
exit;
if Task2."System To-do Type" = "System To-do Type"::Team then begin
TeamSalesperson.SetRange("Team Code", Task2."Team Code");
if TeamSalesperson.Find('-') then
repeat
TempAttendee.CreateAttendee(
TempAttendee,
Task2."No.", 10000,
TempAttendee."Attendance Type"::"To-do Organizer",
TempAttendee."Attendee Type"::Salesperson,
TeamSalesperson."Salesperson Code",
true);
CreateSubTask(TempAttendee, Task2);
TempAttendee.DeleteAll
until TeamSalesperson.Next() = 0
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeCreateOrganizerTask(var Task: Record "To-do"; var IsHandled: Boolean)
begin
end;
Thank you.
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 47148.