Description:-
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 file path as the parameter.It splits the file path into three different strings file path, file name, file extension respectively.The usage of the function can be seen below.
Create Job from AOT:-
- In the AOT, click Job.
- Right-click the Job node, and then select New Job.
static void Filename(Args _args) { Filename filepath; Filename filename; Filename fileType; str fileNameString,fileNamePath; ; fileNamePath=@"C:\Users\umesh.adroja\Desktop\DocumentsFile.docx"; [filepath, filename, fileType] = fileNameSplit(fileNamePath); fileNameString= filename + fileType; info(strFmt("filename=%1 \nfileType=%2",filename,fileType)); }
Now the
fileNameString will return you the file name with extension.
2 comments
commentsI'm gone tto convey my little brother, that he should also visit this weblog on regular basis
Replyto obtain updated from newest reports.
Hi Umesh.,
Replyi just wondering how to define/specify if the file in the different komputer/server?
i have try to write the path like this :
fileName = "\\[IP ADDRESS]\\[shared folder]\\testing.xlsx)";
but is not work.
do you have a solution for this?
thank u.
Thanks for comments.....