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

Dynamics ax 2012: Sample code for fetching records in tmp table using query and Insert record set