web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

How can i get all files names with file extensions in D365 BC?

(0) ShareShare
ReportReport
Posted on by 45

Files.PNG

I'm trying to get list of files from a directory in D365 Business central (Cloud), I don't know how can i get those files paths.

In Dynamics NAV we can get all files path dynamically using this record var "File" like below code.

Var
FileRec: Record File;

FileRec.RESET;

FileRec.SETRANGE(Path,'E:\Dynamically\');

FileRec.SETRANGE("Is a file",TRUE);

IF FileRec.FINDSET THEN BEGIN

 REPEAT

   MESSAGE(FileRec.Name);

 UNTIL FileRec.NEXT =0;

END;

O/P of above code:

  'E:\Dynamically\1.txt'

  'E:\Dynamically\2.txt'

  'E:\Dynamically\3.txt'

So, Is there any way to do this into D365 BC(SaaS)?

Reply

Categories:
  • Krzysztof Bialowas Profile Picture
    500 on at

    Hi,

    Can you say more about this problem? What is the version which you are using? on-prem or cloud?

    Best regards,

    Krzysztof

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    If you're talking about SaaS, this is not possible. SaaS can't see your local E: drive. You should use File.UploadIntoStream.

    If instead you're talking about on-premise (target: internal in app.json) you can do that as usual.

  • Sangit Panchal Profile Picture
    45 on at

    I'm trying to get list of files from a directory in D365 Business central (Cloud), I don't know how can i get those files paths.

    In Dynamics NAV we can get all files path dynamically using this record var "File" like below code.

    Var
    FileRec: Record File;
    
    FileRec.RESET;
    
    FileRec.SETRANGE(Path,'E:\Dynamically\');
    
    FileRec.SETRANGE("Is a file",TRUE);
    
    IF FileRec.FINDSET THEN BEGIN
    
     REPEAT
    
       MESSAGE(FileRec.Name);
    
     UNTIL FileRec.NEXT =0;
    
    END;

    O/P of above code:
    
      'E:\Dynamically\1.txt'
    
      'E:\Dynamically\2.txt'
    
      'E:\Dynamically\3.txt'

    So, Is there any other way to do this into D365 BC(SaaS)?

  • Community Member Profile Picture
    on at

    Is there a way to get list of contents in a Sharepoint folder in D365BC (SaaS)?

    Example : I know the location where the files are stored in Sharepoint but I do not know how to get the filenames of the content inside the folder.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    You can use Sharepoint REST APIs to do that.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans