Repository navigation
[API tests] Initialize cancellation reason-code fixtures #11225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
17423f0
00823ca
367ffb6
3d88414
004919a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -958,6 +958,7 @@ codeunit 139809 "APIV2 - Sales Invoices E2E" | |
| DocumentId := SalesInvoiceHeader."Draft Invoice SystemId"; | ||
|
|
||
| // Special case for AU | ||
| EnsureReasonCode(); | ||
| LibrarySales.SetDefaultCancelReasonCodeForSalesAndReceivablesSetup(); | ||
|
|
||
| Commit(); | ||
|
|
@@ -997,6 +998,7 @@ codeunit 139809 "APIV2 - Sales Invoices E2E" | |
| DocumentId := SalesInvoiceHeader."Draft Invoice SystemId"; | ||
|
|
||
| // Special case for AU | ||
| EnsureReasonCode(); | ||
| LibrarySales.SetDefaultCancelReasonCodeForSalesAndReceivablesSetup(); | ||
|
|
||
| Commit(); | ||
|
|
@@ -1358,9 +1360,22 @@ codeunit 139809 "APIV2 - Sales Invoices E2E" | |
| local procedure CreateCancelledSalesInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header") | ||
| begin | ||
| CreatePostedSalesInvoice(SalesInvoiceHeader); | ||
| EnsureReasonCode(); | ||
| LibrarySales.SetDefaultCancelReasonCodeForSalesAndReceivablesSetup(); | ||
| Commit(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The newly added Commit executes from TestActionSendCancelledInvoice through CreateCancelledSalesInvoice, but the test codeunit does not declare a TransactionModel for the test. With the default AutoRollback transaction model, the commit path can fail before the API behavior is verified; set the affected test to AutoCommit and run it under an isolation-enabled test runner. Knowledge: 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.47.6 |
||
| CODEUNIT.Run(CODEUNIT::"Correct Posted Sales Invoice", SalesInvoiceHeader); | ||
| end; | ||
|
|
||
| local procedure EnsureReasonCode() | ||
| var | ||
| ReasonCode: Record "Reason Code"; | ||
| begin | ||
| if not ReasonCode.IsEmpty() then | ||
| exit; | ||
|
|
||
| LibraryERM.CreateReasonCode(ReasonCode); | ||
| end; | ||
|
|
||
| local procedure CreateSalesInvoices(var InvoiceID1: Text; var InvoiceID2: Text) | ||
| var | ||
| SalesInvoiceHeader: Record "Sales Invoice Header"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added Commit executes from TestActionSendCancelledInvoice through CreateCancelledSalesInvoice, but the test codeunit does not declare a TransactionModel for the test. With the default AutoRollback transaction model, the commit path can fail before the API behavior is verified; set the affected test to AutoCommit and run it under an isolation-enabled test runner.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.47.6