[Bug]: Deliv.-Rem. Ext. Text Transfer: OnAfterReadLines will never be reached due to exit(true)

Abierto Apto para principiantes
#13,205 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Área
backend

Línea de trabajo

Lee codeunit 5005272, "Deliv.-Rem. Ext. Text Transfer", y compara su función ReadLines con codeunit 378, "Transfer Extended Text", concretamente con ReadExtTextLines. Comprueba cómo afecta exit(true) a OnAfterReadLines cuando se encuentra texto extendido e identifica las pruebas pertinentes para este comportamiento. Se considerará terminado cuando se alcance OnAfterReadLines después de leer las líneas y el comportamiento coincida con el de la función de referencia.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Team: Finance
Describe the issue

In the codeunit 5005272 "Deliv.-Rem. Ext. Text Transfer" there is the function ReadLines. The OnAfterReadLines Event will never be reached because of exit(true) if there are extended texts found. It should work similar as the codeunit 378 "Transfer Extended Text" function ReadExtTextLines.

Expected behavior

Here is the fix:

    procedure ReadLines(var ExtTextHeader: Record "Extended Text Header"; DocDate: Date; LanguageCode: Code[10]): Result: Boolean
    var
        ExtTextLine: Record "Extended Text Line";
        IsHandled: Boolean;
    begin
        IsHandled := false;
        Result := false;
        OnBeforeReadLines(ExtTextHeader, DocDate, LanguageCode, IsHandled, Result, TempExtTextLine);
        if IsHandled then
            exit(Result);

        ExtTextHeader.SetCurrentKey(
          "Table Name", "No.", "Language Code", "All Language Codes", "Starting Date", "Ending Date");
        ExtTextHeader.SetRange("Starting Date", 0D, DocDate);
        ExtTextHeader.SetFilter("Ending Date", '%1..|%2', DocDate, 0D);
        if LanguageCode = '' then begin
            ExtTextHeader.SetRange("Language Code", '');
            if not ExtTextHeader.Find('+') then
                exit;
        end else begin
            ExtTextHeader.SetRange("Language Code", LanguageCode);
            if not ExtTextHeader.Find('+') then begin
                ExtTextHeader.SetRange("All Language Codes", true);
                ExtTextHeader.SetRange("Language Code", '');
                if not ExtTextHeader.Find('+') then
                    exit;
            end;
        end;

        ExtTextLine.SetRange("Table Name", ExtTextHeader."Table Name");
        ExtTextLine.SetRange("No.", ExtTextHeader."No.");
        ExtTextLine.SetRange("Language Code", ExtTextHeader."Language Code");
        ExtTextLine.SetRange("Text No.", ExtTextHeader."Text No.");
        if ExtTextLine.Find('-') then begin
            TempExtTextLine.DeleteAll();
            repeat
                TempExtTextLine := ExtTextLine;
                TempExtTextLine.Insert();
            until ExtTextLine.Next() = 0;
            Result := true;
        end;
        OnAfterReadLines(TempExtTextLine, ExtTextHeader, LanguageCode);
    end;
Steps to reproduce

Please see codeunit 378 "Transfer Extended Text" function ReadExtTextLines for the correct behavior.

Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug
Lenguaje dominante
AL
Estrellas
720
Forks
488
Merge medio
2 d 17 h
PR fusionados (30 d)
568

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/BCApps

Todos los issues de microsoft/BCApps

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.