Skip to main content

Notifications

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 100
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();
}

  • srttel Profile Picture
    on at
    RE: App install data in specific table

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans