[W1][MultiObjects] Undo Service Shipment Line / Undo Service Consumption Line - OnAfter event after the corrective Service Shipment Line is inserted
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
- 70/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend
Direzione di ricerca
Leggi i Codeunits 5818 “Undo Service Shipment Line” e 5819 “Undo Service Consumption Line”, concentrandoti su InsertNewShipmentLine e InsertCorrectiveShipmentLine. Aggiungi gli Integration Events richiesti dopo l’inserimento, con i record delle righe di spedizione nuove e precedenti. Verifica quindi che ogni evento venga generato immediatamente dopo Insert() e una volta per ciascuna riga stornata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why do you need this change?
Our app stores data in a companion table that is linked to document lines and posted document lines by SystemId. When a posted line is undone, we must copy that data from the original posted line to the new corrective line, so we need both records at the moment the corrective line is inserted.
For Sales and Purchase this is possible with the existing events raised right after the corrective line insert:
- Codeunit 5815 "Undo Sales Shipment Line":
OnAfterNewSalesShptLineInsert(var NewSalesShipmentLine; OldSalesShipmentLine) - Codeunit 5813 "Undo Purchase Receipt Line":
OnAfterNewPurchRcptLineInsert(...) - "Undo Return Shipment Line" / "Undo Return Receipt Line":
OnAfterNewReturnShptLineInsert(...)/OnAfterNewReturnRcptLineInsert(...)
The Service equivalents have no such event:
- Codeunit 5818 "Undo Service Shipment Line" raises
OnBeforeNewServiceShptLineInsert(NewServShptLine, OldServShptLine)before the insert, but nothing after it. The laterOnAfterInsertNewShipmentLineinCodeonly receives the old line, so the new line (and its SystemId) is not available. - Codeunit 5819 "Undo Service Consumption Line" raises
OnInsertCorrectiveShipmentLineOnBeforeInsert(...)before the insert, but nothing after it.
Before the insert the SystemId is not assigned yet. As a workaround we now search for the corrective line afterwards with a filter (Correction = true, same Order No./Order Line No., greater Line No.). This is fragile when several lines are undone in one run and it costs an extra read per line. Any extension that keeps line-level data keyed by SystemId (or that needs to copy custom data to the corrective line after insert) has the same gap in Service.
Describe the request
Add one OnAfter integration event directly after the corrective Service Shipment Line is inserted, in both codeunits, mirroring OnAfterNewSalesShptLineInsert. Both objects are in one request because it is the same change for the same scenario (undoing posted service lines).
[W1][Codeunit][5818][Undo Service Shipment Line]
procedure InsertNewShipmentLine
___
Raise an event after NewServShptLine.Insert(), with the new and the old line (same signature as OnBeforeNewServiceShptLineInsert).
___
NewServShptLine.Correction := true;
NewServShptLine."Dimension Set ID" := OldServShptLine."Dimension Set ID";
OnBeforeNewServiceShptLineInsert(NewServShptLine, OldServShptLine);
NewServShptLine.Insert();
OnAfterNewServiceShptLineInsert(NewServShptLine, OldServShptLine); // new
InsertItemEntryRelation(TempGlobalItemEntryRelation, NewServShptLine);
end;
[IntegrationEvent(false, false)]
local procedure OnAfterNewServiceShptLineInsert(var NewServiceShipmentLine: Record "Service Shipment Line"; OldServiceShipmentLine: Record "Service Shipment Line")
begin
end;
[W1][Codeunit][5819][Undo Service Consumption Line]
procedure InsertCorrectiveShipmentLine
___
Raise an event after NewServiceShipmentLine.Insert(), with the new and the old line (same signature as OnInsertCorrectiveShipmentLineOnBeforeInsert).
___
NewServiceShipmentLine.Correction := true;
OnInsertCorrectiveShipmentLineOnBeforeInsert(NewServiceShipmentLine, OldServiceShipmentLine);
NewServiceShipmentLine.Insert();
OnInsertCorrectiveShipmentLineOnAfterInsert(NewServiceShipmentLine, OldServiceShipmentLine); // new
UpdateItemJnlLine(NewServiceShipmentLine, ItemShptEntryNo);
if OldServiceShipmentLine.Type = OldServiceShipmentLine.Type::Item then begin
[IntegrationEvent(false, false)]
local procedure OnInsertCorrectiveShipmentLineOnAfterInsert(var NewServiceShipmentLine: Record "Service Shipment Line"; OldServiceShipmentLine: Record "Service Shipment Line")
begin
end;
Notes:
- No IsHandled, no behavior change. Raised once per undone line, with no extra database reads.
- The records are already in scope at that point, and no sensitive data is exposed.
Related requests (Service parity with Sales/Purchase, same scenario family): #13251 (service line pages OnAfterNoOnAfterValidate), #13251 (Service Line InitType), #13251 (Serv-Documents Mgt. finalize line events)
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
- Lingua principale
- AL
- Stelle
- 714
- Fork
- 482
- Merge medio
- 3g 5h
- PR unite (30g)
- 559
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/BCApps
-
Team: SCM
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
microsoft/BCApps#13322 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Deliv.-Rem. Ext. Text Transfer: OnAfterReadLines will never be reached due to exit(true)ApertaTeam: Finance
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/BCApps#13205 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: FI reference payment matching scans Cust. Ledger Entry because "Reference No." has no keyForse già presa @AndersLarsenMicrosoft l’ha presa 5 giorni fa. ApertaApproved Team: Finance
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/BCApps#13101 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Team: Finance
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/BCApps#13082 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Imported Subscription Line processing misses two fieldsForse già presa @AndersLarsenMicrosoft l’ha presa 5 giorni fa. ApertaApproved Team: Finance
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/BCApps#13004 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/BCApps
Issue simili
-
vorbis: Inverse coupling runs in wrong orderForse già presa @computerfan l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
stdDate.WeekdayName raises type mismatch and ignores explicit first day during Weekday lookupAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vekexasia/pi-extensible-workflows#374 ·
I maintainer di solito rispondono entro 2 giorni
-
JSON-RPC errors quote the values of the request, and the relay logs the start of a refused frameAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pollen-robotics/reachy_mini#1516 ·
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno