Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#13,205 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Ambito
backend

Direzione di ricerca

Leggi codeunit 5005272, "Deliv.-Rem. Ext. Text Transfer", e confronta la sua funzione ReadLines con quella di codeunit 378, "Transfer Extended Text", in particolare con ReadExtTextLines. Verifica come exit(true) influisce su OnAfterReadLines quando viene trovato del testo esteso e individua i test pertinenti per questo comportamento. Il lavoro è completato quando OnAfterReadLines viene raggiunto dopo la lettura delle righe e il comportamento corrisponde a quello della funzione di riferimento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
AL
Stelle
714
Fork
482
Merge medio
3g 5h
PR unite (30g)
559

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/BCApps

Tutte le issue di microsoft/BCApps

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.