BCApps icon indicating copy to clipboard operation
BCApps copied to clipboard

[NextMajor 29.0] [ES] SII Sales/Purchase Subscribers fail with "current permissions prevented the action" in automated tests

Open Subhavarman opened this issue 4 months ago • 2 comments

Hi all,

Validating our extensions against NextMajor (Base Application 29.0.52530.0), our automated tests fail only in the Spanish (ES) localization — W1 and other countries pass. It reproduces across all 70+ of our apps and the stack points to Microsoft localization code, not ours.

When a test creates a Sales/Purchase Header, the OnInsert → InitInsert → InitRecord → OnAfterInitRecord path hits the ES SII subscriber codeunits, which fail.

Error 1 (Sales): Sorry, the current permissions prevented the action. (CodeUnit 7000127 SII Sales Subscribers Execute: Base Application)

Call Stack:
Sales Header(Table 36).OnAfterInitRecord(Event) line 2 - Base Application by Microsoft version 29.0.51777.0
Sales Header(Table 36).InitRecord line 62 - Base Application by Microsoft version 29.0.51777.0
Sales Header(Table 36).InitInsert line 24 - Base Application by Microsoft version 29.0.51777.0
Sales Header(Table 36).OnInsert(Trigger) line 9 - Base Application by Microsoft version 29.0.51777.0
Library - Sales(CodeUnit 130509).CreateSalesHeader line 8 - Application Test Library by Microsoft version 29.0.51777.0
TestCodeunit(CodeUnit 50100).CreateSalesOrderWithLot line 5 - Tests - SampleTestProject version 1.0.0.0
TestCodeunit(CodeUnit 50100).T0001_Test_001 line 17 - Tests - SampleTestProject version 1.0.0.0
Test Runner - Mgt(CodeUnit 130454).RunTests line 26 - Test Runner by Microsoft version 29.0.51777.0
Test Runner - Isol. Codeunit(CodeUnit 130450).OnRun(Trigger) line 4 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunTests line 2 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunSelectedTests line 35 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunNextTest line 20 - Test Runner by Microsoft version 29.0.51777.0
Command Line Test Tool(Page 130455).RunNextTest - OnAction(Trigger) line 7 - Test Runner by Microsoft version 29.0.51777.0

Error 2 (Purchase): Sorry, the current permissions prevented the action. (CodeUnit 7000126 SII Purchase Subscribers Execute: Base Application)

Call Stack:
Purchase Header(Table 38).OnAfterInitRecord(Event) line 2 - Base Application by Microsoft version 29.0.51777.0
Purchase Header(Table 38).InitRecord line 47 - Base Application by Microsoft version 29.0.51777.0
Purchase Header(Table 38).InitInsert line 23 - Base Application by Microsoft version 29.0.51777.0
Purchase Header(Table 38).OnInsert(Trigger) line 8 - Base Application by Microsoft version 29.0.51777.0
Library - Purchase(CodeUnit 130512).CreatePurchHeader line 8 - Application Test Library by Microsoft version 29.0.51777.0
TestCodeunit(CodeUnit 50100).CreatePurchaseOrder line 4 - Tests - SampleTestProject version 1.0.0.0
TestCodeunit(CodeUnit 50100).T0002_Test_002 line 15 - Tests - SampleTestProject version 1.0.0.0
Test Runner - Mgt(CodeUnit 130454).RunTests line 26 - Test Runner by Microsoft version 29.0.51777.0
Test Runner - Isol. Codeunit(CodeUnit 130450).OnRun(Trigger) line 4 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunTests line 2 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunSelectedTests line 35 - Test Runner by Microsoft version 29.0.51777.0
Test Suite Mgt.(CodeUnit 130456).RunNextTest line 20 - Test Runner by Microsoft version 29.0.51777.0
Command Line Test Tool(Page 130455).RunNextTest - OnAction(Trigger) line 7 - Test Runner by Microsoft version 29.0.51777.0

Repro: NextMajor 29.0 ES container + test toolkit → call Library - Sales.CreateSalesHeader (or Library - Purchase.CreatePurchHeader) in a test → run via standard test runner (TestPermissions = Restrictive) → fails inside CodeUnit 7000127/7000126.

Suspected cause: only happens under the runner's default Restrictive context, so the SII subscribers seem to run without the execute/inherent permissions they need — even Microsoft's own test library can't init a header in ES. Looks like a NextMajor regression rather than a test issue (ES-only, MS test library, 29.0-only).

Questions:

  1. Known change/regression in ES for 29.0?
  2. Should 7000126/7000127 carry InherentPermissions/InherentEntitlements?
  3. If by design, recommended fix — Permissions Mock in OnBeforeTestRun, or a specific permission set?

Subhavarman avatar Jul 13 '26 12:07 Subhavarman

:robot: AI triage completed. Product group, please validate the triage report (Microsoft internal access only, use Ctrl+Click to open in new tab).


Was this triage helpful? React with :thumbsup: or :thumbsdown: on this comment to provide feedback.

github-actions[bot] avatar Jul 27 '26 07:07 github-actions[bot]

The issue has now been resolved, and no errors are encountered while validating our extensions against BC NextMajor v29.0, in the ES localization.

As the problem has been addressed, I'm closing this issue. Thank you for your support!

Subhavarman avatar Jul 27 '26 14:07 Subhavarman