[Event Request] Add PreviewMode parameter to Purchase Post events
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
Describe the issue
Some of the Purchase posting codeunit events do not have PreviewMode parameter in it.
This makes it harder for partner to prevent their code running if the posting is in PreviewMode.
We should add PreviewMode to any events that has SuppressCommit on below codeunit:
codeunit 90 "Purch.-Post"
Expected behavior
Here's an example on codeunit 90 "Purch.-Post"
internal procedure RunWithCheck(var TransferHeader2: Record "Transfer Header")
begin
...
OnAfterProcessPurchLines(PurchHeader, PurchRcptHeader, PurchInvHeader, PurchCrMemoHeader, ReturnShptHeader, WhseShip, WhseReceive, PurchaseLinesProcessed, SuppressCommit, EverythingInvoiced, PreviewMode);
...
...
OnAfterPostPurchaseDoc(PurchaseHeader2, GenJnlPostLine, PurchRcptHeader."No.", ReturnShptHeader."No.", PurchInvHeader."No.", PurchCrMemoHeader."No.", SuppressCommit, PreviewMode);
...
end;
[IntegrationEvent(false, false)]
local procedure OnAfterProcessPurchLines(var PurchHeader: Record "Purchase Header"; var PurchRcptHeader: Record "Purch. Rcpt. Header"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var ReturnShipmentHeader: Record "Return Shipment Header"; WhseShip: Boolean; WhseReceive: Boolean; var PurchLinesProcessed: Boolean; CommitIsSuppressed: Boolean; EverythingInvoiced: Boolean; PreviewMode: Boolean)
begin
end;
[IntegrationEvent(false, false)]
procedure OnAfterPostPurchaseDoc(var PurchaseHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; PurchRcpHdrNo: Code[20]; RetShptHdrNo: Code[20]; PurchInvHdrNo: Code[20]; PurchCrMemoHdrNo: Code[20]; CommitIsSupressed: Boolean; PreviewMode: Boolean)
begin
end;
Steps to reproduce
n/a
Additional context
BusinessCentralApps/issues/1430
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in codeunit 90 "Purch.-Post" and inspect each event that uses SuppressCommit, including OnAfterProcessPurchLines and OnAfterPostPurchaseDoc. Trace their invocations and declarations, then verify that every applicable event exposes PreviewMode and that the application still compiles with existing subscribers.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100