Dynamics Search Engine

Thursday, June 14, 2012

How to use Windows File Path Dialog in Microsoft Dynamics® AX 2012

How to use Windows File Path Dialog in Microsoft Dynamics® AX 2012


Applied on:
Microsoft Dynamics® AX 2012 CU2.

Assumption:
This article is for those who has at least basic data flow, navigation and programming
knowledge of Dynamics® AX.

About this article:
This article may answers your question like-
In Microsoft Dynamics® AX 2012 how to call Windows File Path Dialog?
How to use Windows File Path Dialog in X++ language?
How to call WinAPI from Dynamics AX using X++ language?
How to take file path input from user?


I have written a job mentioned below which shows how to use Windows File Path Dialog with New Folder button option.


static void CallWinFilePathDialog(Args _args)
{
    FilePath filepath; // To hold path value
    filepath = WinAPI::browseForFolderDialog("Description goes here", "Selected path goes here", true);
    info(FilePath); // To Display
    // Here you can use your TableName.FieldName = filepath to store the value.
}

The above code execution displays below dialog:



You can create a button called Browse and implement above code to its clicked method.

3 comments:

  1. Hoi Rajesh, interessante artikel. Maar is er ook de mogelijkheid om door bestanden te bladeren?

    Dank u voor deze post.

    ReplyDelete
    Replies
    1. Hi,
      There is a way to achieve this but when you browse for file. In this case the code would be different.
      The above code is applicable for folder only.
      Thanks for your comments.

      Delete
  2. Hi Rajesh

    how to browse for file,

    ReplyDelete