Takeout License using x++ :
//Job exports Dynamics
AX license information to a license file
static void Adit_ExportLicenseFile(Args _args)
{
SysConfig sysConfig;
AsciiIO file = new AsciiIO("c:\\license.txt", "W"); //TODO: 1. Ashok define file name and path
;
file.read();
file.write("LicenseVersion 2");
file.write("");
select sysConfig
where sysConfig.configType == ConfigType::LicenseName; // SET FOR AX 2009 version
file.write(strFmt("License #%1", sysConfig.value));
file.write(" Properties");
select sysConfig
where sysConfig.configType == ConfigType::SerialNo;
file.write(strFmt(" Serial #%1", sysConfig.value));
file.write(" EndProperties");
file.write("");
file.write(" Codes");
file.write("");
while select sysConfig
order by id
where sysConfig.configType == ConfigType::AccessCodes &&
sysConfig.value != ""
{
file.write(strFmt(" CodeLine #%1", sysConfig.id + 1));
file.write(strFmt(" Value #%1", sysConfig.value));
file.write(" EndCodeLine");
file.write("");
}
file.write(" EndCodes");
file.write("");
file.write("EndLicense");
box::info("Done!");
}
0 comments:
Post a Comment