Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get the folder path in X++

(0) ShareShare
ReportReport
Posted on by 10

Hi, 

Is it possible to open the local explorer and select the folder from D365 FO form display?

I would like to get the path of folder to export some reports. 

It is like the browser button of the file upload button, but not for import. I need to get the folder path to export report.

pastedimage1633350442711v1.png

pastedimage1633355495889v2.png

I tried to put code belowed. But it does not work.

public void clicked()

        {

              super();

              FilePath filepath;

             filepath = WinAPI::browseForFolderDialog("Description goes here", "Selected path goes here", true);

             info(FilePath);

         }

Does anyone have any idea to get the folder path with open local explorer?

Thank you.

  • MayO Profile Picture
    10 on at
    RE: How to get the folder path in X++

    Hi Nikolaos,

    I am so appreciated your reply.

    Now, I got it clearly.

    It is really helpful for me.

    Thank you so much !!

    Sincerely,

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the folder path in X++

    Hi, 

    It's your browser that is accessing your folders and sending & fetching files. Not D365. That's why you can't tell D365 to generate a report and finally (a bit later) save it to your local folder. But you can ask D365 to generate a report to screen, and when it's done you can manually download it to your local folder.

    It's just the same than with any other websites. You can download images from Facebook but Facebook can't upload images to your local folder. 

  • MayO Profile Picture
    10 on at
    RE: How to get the folder path in X++


    Hi, Nikolaos!


    I really appreciate your quick reply.

    I got the reasons why AX2012 can be accessed by local explorer. Super clear.

    However, when I upload some files, it seems like I can access the explorer from D365 FO. ( I am sorry the last post I forgot posting the picture...)

    pastedimage1633396770614v1.png

    Also, I can download some reports to my local specific download folder.

    pastedimage1633396865445v3.png

    If the web app cannot access my local explorer, I am not supposed to be able to do these import and download processes with D365 FO. But I can do this on D365 FO. That is why I am kind of confused about it.

    Please let me know why I can access my local explorer.

    Regards!

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the folder path in X++

    AX2012 is not a web applocation, it runs on a server in your company network and can access resources in that network. D365FO runs in the cloud and can't access any local resources that are not published to be accessible from public internet. And your C folder is definetely (and luckily) not accessible from public internet.

    The web browser runs on your computer, therefore you can use the browser to upload/download files on your computer. But a website such as D365 can't do such things. A website can try to offer a file for download but the browser and the user are the ones who do the downloading part (and decide the folder). 

  • MayO Profile Picture
    10 on at
    RE: How to get the folder path in X++

    Hi Nikolaos,

    Thank you so much for your reply.

    I have two questions about this.

    First of all, could D365 FO be accessed local explorer and select specific file when onlyt we try to import file using by the filel upload button, not export?

    According the pic posted below, it seems like I can access local explorer and select specific file to import file with file upload button. (I just want to make sure if my idea is correct...)

    Secondaly, is AX 2012 not webaplication?

    When I google to solve this problems, there are some websites it seems like AX 2012 can be solve this problems using by WinAPI method or sth like that. (sorry im a so begginer...)

    If you know these answer of my questions, please let me know.

    Sincerely,

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the folder path in X++

    Hi MayO,

    it's not possible, D365FO is a web application and can't see or access your local folders.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,161 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,942 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans