Why do you need this change?
Problem statement:
Our module works with web orders and this require skip confirmations during Sales Advance Header create. We ask for option how to skip confirmations during this process for automatic tasks.
Alternatives evaluated:
There is no event that allow skip confirmation dialog and skip open page.
Proposed publisher location:
Object: Report 31012 "Create Sales Adv. Letter CZZ".OnPostReport near to confirmation codeunit.
Proposed code snippet (before -> after):
trigger OnPostReport()
var
ConfirmManagement: Codeunit "Confirm Management";
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
IsHandled: Boolean;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
OpenAdvanceLetterQst: Label 'Do you want to open created Advance Letter?';
begin
case SourceType of
SourceType::SalesOrder:
begin
CreateAdvanceLetterHeader(SourceSalesHeader);
CreateAdvanceLetterLine(TempSalesLine);
CreateAdvanceLetterApplication();
end;
SourceType::Job:
begin
CreateAdvanceLetterHeader(SourceJob);
CreateAdvanceLetterLine(TempJobPlanningLine);
end;
SourceType::JobTask:
begin
CreateAdvanceLetterHeader(SourceJobTask);
CreateAdvanceLetterLine(TempJobPlanningLine);
end;
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
OnPostReportOnBeforeConfitmOpenAdvanceLetter(SalesAdvLetterHeaderCZZ, IsHandled);
if not IsHandled then
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
if ConfirmManagement.GetResponseOrDefault(OpenAdvanceLetterQst, false) then
if GuiAllowed() then
Page.Run(Page::"Sales Advance Letter CZZ", SalesAdvLetterHeaderCZZ);
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
[IntegrationEvent(false, false)]
local procedure OnPostReportOnBeforeConfitmOpenAdvanceLetter(SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; var IsHandled: boolean)
begin
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
Performance & data considerations:
There is no addition cycles and actions so there don't change performance. Data are not affected because everything is created only show card will be skipped.
Multi‑extension interaction:
There is no conflict with another extension because it doesn't skip function or procedures with events.
Justification for using IsHandled over alternatives:
We tried find another solution, but there is no another option then isHandled.
Describe the request
trigger OnPostReport()
var
ConfirmManagement: Codeunit "Confirm Management";
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
IsHandled: Boolean;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
OpenAdvanceLetterQst: Label 'Do you want to open created Advance Letter?';
begin
case SourceType of
SourceType::SalesOrder:
begin
CreateAdvanceLetterHeader(SourceSalesHeader);
CreateAdvanceLetterLine(TempSalesLine);
CreateAdvanceLetterApplication();
end;
SourceType::Job:
begin
CreateAdvanceLetterHeader(SourceJob);
CreateAdvanceLetterLine(TempJobPlanningLine);
end;
SourceType::JobTask:
begin
CreateAdvanceLetterHeader(SourceJobTask);
CreateAdvanceLetterLine(TempJobPlanningLine);
end;
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
OnPostReportOnBeforeConfitmOpenAdvanceLetter(SalesAdvLetterHeaderCZZ, IsHandled);
if not IsHandled then
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
if ConfirmManagement.GetResponseOrDefault(OpenAdvanceLetterQst, false) then
if GuiAllowed() then
Page.Run(Page::"Sales Advance Letter CZZ", SalesAdvLetterHeaderCZZ);
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:BEGIN
[IntegrationEvent(false, false)]
local procedure OnPostReportOnBeforeConfitmOpenAdvanceLetter(SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; var IsHandled: boolean)
begin
end;
//------------------------------------------OnPostReportOnBeforeConfitmOpenAdvanceLetter:END
Why do you need this change?
Problem statement:
Our module works with web orders and this require skip confirmations during Sales Advance Header create. We ask for option how to skip confirmations during this process for automatic tasks.
Alternatives evaluated:
There is no event that allow skip confirmation dialog and skip open page.
Proposed publisher location:
Object: Report 31012 "Create Sales Adv. Letter CZZ".OnPostReport near to confirmation codeunit.
Proposed code snippet (before -> after):
Performance & data considerations:
There is no addition cycles and actions so there don't change performance. Data are not affected because everything is created only show card will be skipped.
Multi‑extension interaction:
There is no conflict with another extension because it doesn't skip function or procedures with events.
Justification for using IsHandled over alternatives:
We tried find another solution, but there is no another option then isHandled.
Describe the request