ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Bug]: ICInboxOutboxMgt modifies Sales Header and Purchase Header without permission in the codeunit

Open Wiechardt opened this issue 1 year ago • 3 comments

Describe the issue

The CreateOutboxSalesDocTrans procedure modified the Sales Header but the codeunit does not have permissions added, this causes an error when a user without direct modify permission to the Sales Header to approve a Sales Document which triggers the inter-company process.

Image

Expected behavior

The codeunit should be modified to add permissions to the the Sales Header and Purchase Header tables as shown below:

codeunit 427 ICInboxOutboxMgt { Permissions = TableData "General Ledger Setup" = rm, TableData "Sales Header" = rm, TableData "Sales Line" = rm, TableData "Purchase Header" = rm, TableData "Purchase Line" = rm;

trigger OnRun()
begin
end;

Steps to reproduce

Create a new user (User1) and assign permissionsets to the user that only allows Indirect Modify on the Sales Header and Sales Line tables.

Get another user (User2) with direct modify and insert permissions to these table to create a new Sales Invoice and ensure the Customer on the Sales Invoice is a Customer with an IC Partner Code assigned to it. Send the Sales Document for approval.

Now login with User1 and attempt to approve the Sales Invoice.

Additional context

No response

I will provide a fix for a bug

  • [x] I will provide a fix for a bug

Wiechardt avatar Nov 20 '25 07:11 Wiechardt

This issue has been approved for contribution ✅ Thanks for contributing.

github-actions[bot] avatar Nov 25 '25 08:11 github-actions[bot]

@JesperSchulz this codeunit is part of the BaseApp that isn't part of this repository.

@Wiechardt you can find the link to the BaseApp repository here: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-contribute-extensibility If you don't have access the fill out the form that is provided there.

duichwer avatar Nov 27 '25 05:11 duichwer

Will do, thanks @JesperSchulz

Wiechardt avatar Nov 27 '25 06:11 Wiechardt