Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#12,559 2 comentarios 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
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
fintech-quant
Área
api

Línea de trabajo

El trabajo está en el codeunit 6402 "E-Doc. Purch. Doc. Helper" de la app AL, dentro de CreatePurchaseLineFromDraft, justo antes de PurchaseLine.Insert(). Lee ese procedimiento y los eventos públicos existentes en la app E-Document para igualar la nomenclatura y el patrón de publicador. Se considera terminado cuando se publica un nuevo evento de integración allí, en un objeto público, con la firma del issue, y una prueba o un suscriptor de ejemplo demuestra que la Purchase Line puede modificarse antes de insertarse.

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

Descripción

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
Lenguaje dominante
AL
Estrellas
714
Forks
482
Merge medio
3 d 9 h
PR fusionados (30 d)
557

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.