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