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

Announcements

No record found.

News and Announcements icon
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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans