Dynamics AX : Get the file name from the File Path using X++
AX has a standard method in the Global Class to split the file name from the entire file path.The method is fileNameSplit().The method takes filepath as the parameter.It splits the filepath into three different strings filepath,filename,fileextension respectively.The usage of the function can be seen below.
Filename filepath;
Filename filename;
Filename fileType;
str fileNameString;
;
[filepath, filename, fileType] = fileNameSplit(fileNamePath);
fileNameString= filename + fileType;
Now the fileNameString will return you the filename with extension.
Filename filepath;
Filename filename;
Filename fileType;
str fileNameString;
;
[filepath, filename, fileType] = fileNameSplit(fileNamePath);
fileNameString= filename + fileType;
Now the fileNameString will return you the filename with extension.
Comments
Post a Comment