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: X++ code to add custom lookup on worker to show specific workers team workers only

Error message when you log on to a Microsoft Dynamics AX 4.0 client: "You are not a recognized user of Microsoft Dynamics AX"