Skip to content

[Event Request] [W1][Report][7000096][Redraw Receivable Bills] OnPostDataItem "dataitem CustLedgEntry" #29605

@jcarrascolbt

Description

@jcarrascolbt

Why do you need this change?

We want to modify "Redraw Receivable Bills" functionality to make it automatic without going through opening the CarteraJnlForm and ensuring the automatic process doesn't stop

Describe the request

[Event Request] [W1][Report][7000096][Redraw Receivable Bills]
OnPostDataItem "dataitem CustLedgEntry"

Our clients want to use this report in a job queue, so they need both that the journal doesn't open automatically and that the message doesn't pop up with each record that is processed.

trigger OnPostDataItem()
    begin
        Window.Close();
        // CarteraDimMgt.CopyJnlLinDim(GenJnlLine,GenJnlLine,TempJnlLineDim,JnlLineDim2);
        Commit();
        GenJnlLine.Reset();
        GenJnlTemplate.Get(TemplName);
        GenJnlLine.FilterGroup := 2;
        GenJnlLine.SetRange("Journal Template Name", TemplName);
        GenJnlLine.FilterGroup := 0;
        GenJnlManagement.SetName(BatchName, GenJnlLine);

        >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        isHandled := false;
        showMessage := false;
        OnBeforeOpenCarteraJournalForm(isHandled, showMessage, GenJnlLine, BatchName);
        if not IsHandled then begin
            CarteraJnlForm.SetTableView(GenJnlLine);
            CarteraJnlForm.SetRecord(GenJnlLine);
            CarteraJnlForm.SetJnlBatchName(BatchName);
            CarteraJnlForm.AllowClosing(true);
            CarteraJnlForm.RunModal();
        end;
        <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

        SplitDetailedCVEntry();

        >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        if showMessage then
            Message(Text1100010, DocCount);
        <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    end;
[IntegrationEvent(false, false)]
local procedure OnBeforeOpenCarteraJournal(var isHandled: Boolean; var showMessage: Boolean; var GenJournalLine: Record "Gen. Journal Line"; BatchName: Code[10])
begin
end;

Alternatives Evaluated
We cannot avoid opnening the journal in each iteration so we need the change to make this automatic.

Performance Considerations
This code shouldn't cause performance issues since it would only skip creating the journal page and its runmodal for an automatic record in the subscriber and the fact that the message doesn't appear at the end.

Data Sensitivity Review
This event is not going to create any security breach.

Multi-Extension Interaction
The only thing we would have to keep in mind is that whoever uses this event creates the journal and records it automatically.
Internal work item: AB#621172

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions