X++ code to copy file from one location to another location

static void WinApiClassestocopythefile(Args _args)
{
#avifiles
boolean present;
SysOperationProgress simpleProgress;
int i;
;

// startlengthyoperation();
SimpleProgress = SysOperationProgress::newGeneral(#aviupdate, 'Simple', 100);
if(WinAPI::fileExists("D:\\Ramesh_Ax_Docs\\AX Books\\AXInstallationGuide.pdf"))
{
for (i=1; i<=100; i++)
{
simpleProgress.incCount();
simpleprogress.setText(strfmt("%1% Of File is being Copied",i));
sleep(200);
}
WinAPI::copyFile("D:\\Ramesh_Ax_Docs\\AX Books\\AXInstallationGuide.pdf","D:\\Ramesh_Ax_Docs\\AXInstallationGuide.pdf",true);
Simpleprogress.kill();
}
else
{
info("This file does not exist");
}
info("The file has been Copied :)");
info(strfmt("The filesize is %1",WinApi::fileSize("D:\\Ramesh_Ax_Docs\\AXInstallationGuide.pdf")));
info(WinAPI::getComputerName());
//endlengthyoperation();
}

X++ Code to add new components in AOT

static void AOTCreatequery(Args _args)
{
// This function will add a new Form to the AOT.
treeNode treeNode;
xInfo xInfo = new xInfo();
;
treeNode = xInfo.rootNode();
treeNode = treeNode::findNode("Forms"); // You can use all the AOT components.
treeNode.AOTadd("Praveen");
treenode.AOTsave();
}

X++ to connect the database in AX 2009

Void DBConnection()
{
LoginProperty LP = new LoginProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
#define.Constring("DSN=DSNName;UID=Username;PWD= ****")

;

LP.setOther(#Constring); //New line added by ramesh
myConnection = new OdbcConnection(LP);
myStatement = myConnection.createStatement();
myResult=myStatement.executeQuery("SELECT * from tablename");

while (myResult.next())
{

Name = any2str(myResult.getString(1));
Id = any2str(myresult.getString(2));
Date = any2date(myresult.getString(3));
}
}

Install and Configure Zpl Printer on D365 F&O

  Setup Zpl Printer On D365 F&O Posted on Recently, I have had an opportunity review the possibilities to print license plates within D3...