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.

Comments

Popular posts from this blog

D365: SSRS Report Development/ Customization

D365/ Ax2012: X++ code for custom lookup to show customer account and Name

D365: Modifying check report along with the slip text