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

Notifications

Announcements

No record found.

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

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 3,098

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,556 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,108 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans