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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Exporting AX Data to .CSV File using Class and Dialog with parameters

(0) ShareShare
ReportReport
Posted on by 916

Hi ,

I have to export data from AX to .csv file to a specific folder using dialog that have two parameter fromDate and toDate. So when i click on the OK of dialog , the data should be exported to cvs file in specific folder.

what steps  can i follow to do that requirement

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    HI Alex,

    You would be able to use the Data Import Export Framework. Depending on the data you need to export you could also use the dat/def definition group based option to export filtered data.

  • ALAhmed Profile Picture
    916 on at

    They are not want  use the DMF or ssrs report , they want just use  a dialog with parameters and when we click on the ok button , the CSV file saved on the specific folder that have path of folder calculated. i think i have to use a batch dialog ?

  • Suggested answer
    RiccardoFiaschi Profile Picture
    65 on at

    Hi,

    There are a number of ways, as André has described. You could also just use the CommaTextIO class to do this:

    https://msdn.microsoft.com/en-us/library/aa624902(v=ax.50).aspx

    See the Tutorial_* classes in AX for an example how to use a dialog.

    Regards,

    Riccardo

  • ALAhmed Profile Picture
    916 on at

    Is there a turoial class  for sysoperation /RunBaseBatch?

    What do you think for using sysoperation /RunBaseBatch?

  • Verified answer
    Dick Wenning Profile Picture
    8,705 Moderator on at

    CommaIo file= new CommaIo(FilePath+"filename.csv","w");

       container buffer;

       DictTable dt = new DictTable(tableNum(YOURTABLE));

       int fieldcount;

       for (fieldcount =1 ;fieldcount <= dt.fieldCnt();fieldcount++)

       {

           buffer += [dt.fieldName(dt.fieldCnt2Id(fieldcount))];

       }

       file.writeExp(buffer);

       while select YOURTABLE

       {

           buffer = ConNull();

           for (fieldcount =1 ;fieldcount <= dt.fieldCnt();fieldcount++)

           {

               buffer +=[YOURTABLE.(dt.fieldCnt2Id(fieldcount))];

           }

           file.writeExp(buffer);

       }

       file.finalize();

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans