web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

BC18: OnInstallAppPerCompany cannot read/modify extension tabledata

(0) ShareShare
ReportReport
Posted on by 25

Hi All,

The code below cannot be published from VSCode to the brand new BC 18.0.23012 online sandbox:

codeunit 50100 XXXInstall
{
    Subtype = Install;

    trigger OnInstallAppPerCompany()
    var
        XXTest: Record XXXTest;
    begin 
        if XXXTest.FindFirst() then;
    end;
}
the error is
'You do not have the following permissions on TableData XXXTest: Read. To view details about your permissions, see the Effective Permissions page. To report a problem, refer to the following server session ID: '11111'.' and AL stack trace: XXXInstall(CodeUnit 50100).OnInstallAppPerCompany line 4 - xxx by SalesPad ""Extension Triggers""(CodeUnit 2000000010).OnInstallAppPerCompany line 2
Modify() gives similar error.
I have moved XXXTest table from 70M to 50K range, this did not help. If I disable the trigger and install the extension, then I can read and modify data. There is just one user account in this database which is SUPER. Here is the sample table object I'm testing at the moment:
table 50100 XXXTest
{
    Caption = 'XXXTest';
    
    fields
    {
        field(1; XXXKey; Code[20])
        {
            Caption = 'Key';
            DataClassification = CustomerContent;
        }
    }
    keys
    {
        key(PK; XXXKey)
        {
            Clustered = true;
        }
    }
    
}
I can use OnInstallAppPerCompany() to read and modify tabledata in standard MS tables (not in the extension being installed). 
The trigger works fine in sandboxes with BC 17.5 and lower.
Please share if you have any ide what could be wrong.
I have the same question (0)
  • Verified answer
    sashakuzmin Profile Picture
    25 on at

    Update: found a workaround for this that works in BC18

    trigger OnInstallAppPerCompany()

       begin

           TaskScheduler.CreateTask(Codeunit::XXXSched, 0, true, CompanyName(), CurrentDateTime() + 10000);

       end;

    Where XXXSched is a "normal" codeunit that does the required in 10 seconds after install.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,572

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 693 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans