PacktPublishing / Automated-Testing-in-Microsoft-Dynamics-365-Business-Central-Second-Edition

Automated Testing in Microsoft Dynamics 365 Business Central - Second Edition, published by Packt
MIT License
39 stars 24 forks source link

A number of standard tests fails due to missing permissions on Lookup Value table (since BC18.4 ) #15

Open lvanvugt opened 3 years ago

lvanvugt commented 3 years ago

Since BC18.4 came out last week these two pipelines, that respectively run Tests-VAT and Test-Fixed Assets against the LookupValue extension, have errors that weren't there before:

Chapter10-LookupValueExtension-BC18-Tests-VAT

Error: Codeunit Id Codeunit Name Function Error
132531 VAT Assisted Setup AssistedVATBusGrpCheckExistingCustomerVAT You do not have the following permissions on TableData LookupValue: Insert.

Chapter10-LookupValueExtension-BC18-Tests-Fixed-Asset

Errors: Codeunit Id Codeunit Name Function Error
134451 ERM Fixed Assets GLEntryVATEntryLinkForVATNetDisposal You do not have the following permissions on TableData LookupValue: Insert.

Clearly in both cases the test fails due to missing permissions on Lookup Value table. This needs to be tackled.

lvanvugt commented 2 years ago

The following 3 tests started to succeed at a certain point in time, probably related to the introduction of a new CU for BC18:

Codeunit Id Codeunit Name Function Error
134478 ERM Dimension Fixed Assets IndexFAWithBalanceAccount There is no Gen. Journal Line within the filter.\Filters: Account No.: 1GU00000657000000000
134478 ERM Dimension Fixed Assets DepreciationBalanceAccountDimension There is no Gen. Journal Line within the filter.\Filters: Account No.: 1GU00001007000000000, Document No.: GL00000032
134978 ERM Fixed Assets Reports BookValueGroupByFAClass Book Value must not be negative or less than Salvage Value on 01/24/23 for Fixed Asset No. = GL00000019 in Depreciation Book Code = GU00000634.

Therefore have removed them from the initial issue report.

lvanvugt commented 2 years ago

First attempt to fix it by adding the following permissionsetextension was not successful:

permissionsetextension 50000 "Lookup Value" extends "D365 BUS FULL ACCESS"
{
    Permissions =
        tabledata LookupValue = RIMD;
}
lvanvugt commented 2 years ago

Last code modification done based on a note by Georgios Papoutakis (MSFT) on this yammer discussion:

The difference with 18.3 is that tests now are running with "D365 FULL ACCESS" Permission Set by default instead of SUPER. Note that this permission set is the absolute maximum you can have in SaaS, so if your test cannot do something, your SaaS users won't be able to do so as well.

But unfortunately this does not make the two tests pass. Have posed a question to Georgios on yammer.