[Event Request] Report 31012 "Create Sales Adv. Letter CZZ".OnPostReport
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
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
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate report 31012 "Create Sales Adv. Letter CZZ" and inspect its OnPostReport trigger around Confirm Management and the "Sales Advance Letter CZZ" page run. Verify the extensibility point supports automatic tasks that need to skip the confirmation and page opening, then validate the report still creates the advance letter data as before.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100