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

[W1][Codeunit][6402][E-Doc. Purch. Doc. Helper] Event before inserting the purchase line created from a draft line

Aperta Adatta ai principianti
#12,559 2 commenti 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
62/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
fintech-quant
Ambito
api

Direzione di ricerca

Il lavoro si trova nel codeunit 6402 "E-Doc. Purch. Doc. Helper" nell'app AL, all'interno di CreatePurchaseLineFromDraft, appena prima di PurchaseLine.Insert(). Leggi quella procedura e gli eventi pubblici esistenti nell'app E-Document per allinearti a nomenclatura e schema publisher. È completato quando in quel punto viene generato un nuovo integration event su un oggetto pubblico, con la firma indicata nell'issue, e un test o un subscriber di esempio dimostra che la Purchase Line può essere modificata prima dell'inserimento.

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

Descrizione

Ownership: Manual Team: Finance
Why do you need this change?

Since 29.0, table 6101 "E-Document Purchase Line" is public, so extensions can add their own fields to draft lines, for example a coding field a clerk fills on the Purchase Document Draft before finalizing.

When the user (or the Payables Agent) runs Finalize draft, CreatePurchaseLineFromDraft in codeunit 6402 "E-Doc. Purch. Doc. Helper" copies only a fixed set of draft fields to the new Purchase Line. Nothing public tells an extension which Purchase Line was created from which draft line:

  • CreatePurchaseLineFromDraft raises no event, and codeunit 6402 is Access = Internal.
  • Table 6141 "E-Doc. Record Link" is Access = Internal.
  • GetLinkedPurchaseLine / GetFromLinkedPurchaseLine on table 6101 are internal.
  • The only public hook, OnAfterProcessIncomingEDocument, fires after the whole document is created, without line context.

Additional Fields does not cover this: it validates values from its own internal store, not an extension's draft-line field.

Extensions are therefore left matching draft lines to invoice lines by position after the fact, which depends on the internal loop order (in 28.1 lines were grouped by receipt; in 29.0 they follow the draft key order).

A second, related need: after the default dimensions and the draft's dimension set are combined, the draft's "[BC] Shortcut Dimension 1 Code" / "[BC] Shortcut Dimension 2 Code" are validated onto the line. A blank draft value therefore removes a default dimension that came from the G/L account. An extension cannot restore it without knowing the source draft line.

Related: #7531 (extending Import Process 2.0).

Describe the request

In codeunit 6402 "E-Doc. Purch. Doc. Helper", procedure CreatePurchaseLineFromDraft, immediately before PurchaseLine.Insert(), raise an integration event that other apps can subscribe to. Because codeunit 6402 is internal, the event needs to be published on a public object (or the publisher made accessible), for example:

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertPurchaseLineFromDraft(EDocumentPurchaseLine: Record "E-Document Purchase Line"; var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
begin
end;

This lets a subscriber copy its own draft-line fields to the Purchase Line and adjust its dimensions before the line is saved, with no extra Modify and no dependency on the internal line order.

Provide an implementation (optional)
  • I will provide the implementation for this extensibility request
Lingua principale
AL
Stelle
714
Fork
482
Merge medio
3g 8h
PR unite (30g)
546

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.