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...
Unanswered

App install data in specific table

(0) ShareShare
ReportReport
Posted on by 108
I have an app and when it is installed I want it to fill in some records in some tables. But it depends on the country of each company that is in Central Business. 
This is my code, but it seems that it is not detecting the name of the company because it does not lack the records.
If I dont' use "if Iso = '170' THEN begin" the code work fine, but I need fill only a specific company. What I am doing wrong?

codeunit 50191 InstalRegCode
{
Subtype = Install;

trigger OnInstallAppPerCompany()
var

CompanyInformation: Record "Company Information";
CountryRegion: Record "Country/Region";
codeCountry: Code[10];
Iso: Code[3];
begin
Iso := '';
CompanyInformation.SetFilter(Name, CompanyName());
if CompanyInformation.FindFirst() then begin

codeCountry := CompanyInformation."Country/Region Code";
CountryRegion.get(codeCountry);
Iso := CountryRegion."ISO Numeric Code";
end;


if Iso = '170' THEN begin
if DCLDocTypeIdentification.IsEmpty then
DCLInsertarTipoDocumento();
}

I have the same question (0)
  • srttel Profile Picture
    Microsoft Employee on at

    Could it be that it is because ISO Numeric Code = 170 does not exist in the table region/country? When I open the table 9 directly and check if the record exist I cannot find it.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,059 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans