AX 2012: Move file to another folder using WinAPI

static void ArisMoveFileUsingWinAPI(Args _args)
{
#File

Filename fPath;
Filename fName;
Filename fType;

FileName DestinationPath = @’D:\DestinationFolder\’;
FileName sourcePath = @’D:\SourceFolder\test.csv’;;

#define.sourcePath(sourcePath)
#define.destinationPath(DestinationPath)

[fPath, fName, fType] = fileNameSplit(#sourcePath);

WinAPI::moveFile(#sourcePath, strFmt(‘%1%2%3’, #destinationPath, fName, fType));

Box::info(‘File\s moved successfully!’);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s