Microsoft Dynamics NAV - Get File Count from a Folder using Dotnet.

Hi All,

Today I want to discuss a code re-write that I had to do on a recent project about file handling.

Scenario -
PDF will be saved in a shared path whenever a purchase invoice is printed. To Generate File Name we were using Purchase Invoice No. and then extending that with an integer.

So if Purchase Invoice (PRO001) Report will be printed for the fifth time, the shared path will already have following files -

PRO001-1.pdf
PRO001-2.pdf
PRO001-3.pdf
PRO001-4.pdf

And Next file name should be PRO001-5.pdf.

Read Complete Article »