This is sample of code to Create and delete folder using axapta in x++ code. This code you can check in job or any button click .
First you need to test this code before applying to production server.
First you need to test this code before applying to production server.
public void CreateFolder()
{
boolean FlagFolderExist,FlagFileExist;
FlagFolderExist = WINAPI::folderExists("C:\\roll\\"+ cate1);
if(FlagFolderExist == false)
{
WINAPI::createDirectoryPath("C:\\roll\\"+rollcate1);
}
FlagFileExist = WINAPI::fileExists("C:\\roll\\" + rollcate1 + "\\" + Tmpemplname);
if(FlagFileExist == true)
{
WINAPI::deleteFile("C:\\roll\\" + rollcate1 + "\\" + Tmpemplname);
}
}