Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 8 AccSchedManagement - Procedure FormatCellAsText - OnBeforeFormatCellAsText #27852

Open
mavohra opened this issue Dec 27, 2024 · 0 comments
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@mavohra
Copy link

mavohra commented Dec 27, 2024

Describe the request

Please add an event OnBeforeFormatCellAsText in procedure FormatCellAsText, at the beginning of the procedure. The IsHandled parameter should be included to allow customization and bypass the default implementation.

procedure FormatCellAsText(var ColumnLayout2: Record "Column Layout"; Value: Decimal; CalcAddCurr: Boolean) ValueAsText: Text[30]
var
   IsHandled: Boolean; // <--- Added variable
begin
   IsHandled := false; 
   OnBeforeFormatCellAsText(ColumnLayout2, Value, IsHandled); // <--- New Event
   if IsHandled then
       exit;

   ValueAsText := MatrixMgt.FormatAmount(Value, ColumnLayout2."Rounding Factor", CalcAddCurr);

   if (ValueAsText <> '') and
      (ColumnLayout2."Column Type" = ColumnLayout2."Column Type"::Formula) and
      (StrPos(ColumnLayout2.Formula, '%') > 1)
   then
       ValueAsText := ValueAsText + '%';

   OnAfterFormatCellAsText(ColumnLayout2, ValueAsText, Value);
end; 

Integration Event Definition

[IntegrationEvent(false, false)]
local procedure OnBeforeFormatCellAsText(var ColumnLayout2: Record "Column Layout"; Value: Decimal; var IsHandled: Boolean)
begin
end;

Additional context

This event is required to allow customizations for specific scenarios in the FormatCellAsText procedure. For example, we have a customization where specific logic is applied to handle "Ledger Entry Type," bypassing the default formatting logic.

This event request is part of a series of three related event requests for Codeunit 8 AccSchedManagement. The requested events aim to enable customization of key procedures for handling calculations, filters, and formatting within account schedules.

The three requested events are:

OnBeforeFormatCellAsText in the FormatCellAsText procedure.
OnAfterSetCFEntryFiltersAccShedLineCopyFilter in the SetCFEntryFilters procedure.
OnAfterSetEntryFilters in the CalcCFAccount procedure.

The remaining 2 events will be requested in a separate request.
Internal work item: AB#561475

@JesperSchulz JesperSchulz added event-request Request for adding an event Finance GitHub request for Finance area labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Finance GitHub request for Finance area
Projects
None yet
Development

No branches or pull requests

2 participants