ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Report 190 "Issue Reminders" - OnBeforeConfirmInvoiceRounding

Open CarlOhlsson opened this issue 3 years ago • 1 comments

With the current code implementation it is not possible to issue reminders from a background session if invoice rounding <> 0.

This code always return false when gui is not allowed and breaks the report. We have a job queue that issue multiple reminders each day but after upgrading from NAV to BC this new code breaks the solution and i see no way to fix it. if not ConfirmManagement.GetResponse(ProceedOnIssuingWithInvRoundingQst, false) then

Current code

report 190 "Issue Reminders"
{
    Caption = 'Issue Reminders';
    ProcessingOnly = true;

    dataset
    {
        dataitem("Reminder Header"; "Reminder Header")
        {
            DataItemTableView = SORTING("No.");
            RequestFilterFields = "No.";
            RequestFilterHeading = 'Reminder';

            trigger OnAfterGetRecord()
            var
                InvoiceRoundingAmount: Decimal;
            begin
                InvoiceRoundingAmount := GetInvoiceRoundingAmount();
                if InvoiceRoundingAmount <> 0 then
                    if not ConfirmManagement.GetResponse(ProceedOnIssuingWithInvRoundingQst, false) then
                        CurrReport.Break();

                RecordNo := RecordNo + 1;
                Clear(ReminderIssue);
                ReminderIssue.Set("Reminder Header", ReplacePostingDate, PostingDateReq);
                ReminderIssue.SetGenJnlBatch(GenJnlBatch);

Suggested event

report 190 "Issue Reminders"
{
    Caption = 'Issue Reminders';
    ProcessingOnly = true;

    dataset
    {
        dataitem("Reminder Header"; "Reminder Header")
        {
            DataItemTableView = SORTING("No.");
            RequestFilterFields = "No.";
            RequestFilterHeading = 'Reminder';

            trigger OnAfterGetRecord()
            var
                InvoiceRoundingAmount: Decimal;
                IsHandled: Boolean;
            begin
                InvoiceRoundingAmount := GetInvoiceRoundingAmount();
                if InvoiceRoundingAmount <> 0 then begin
                   OnBeforeConfirmInvoiceRouding(InvoiceRoundingAmount, "Reminder Header", IsHandled);
                   if not IsHandled then begin
                        if not ConfirmManagement.GetResponse(ProceedOnIssuingWithInvRoundingQst, false) then
                            CurrReport.Break();
                end;

                RecordNo := RecordNo + 1;
                Clear(ReminderIssue);
                ReminderIssue.Set("Reminder Header", ReplacePostingDate, PostingDateReq);
                ReminderIssue.SetGenJnlBatch(GenJnlBatch);

CarlOhlsson avatar Feb 28 '23 09:02 CarlOhlsson

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: 53936.

JesperSchulz avatar Mar 06 '23 17:03 JesperSchulz