how import and export the salesorder lines and headers through X++ code by using classes

please give me suggestions.

What is your AX version? Please elaborate on export options.

Sir,ax2012R3.

Do you want to export data to a file or import data from a file? If so, what is the file format?

You need to provide enough information for someone to answer your question.

csv file sir.

Can you please explain why you want to build something by yourself if there already is a standard solution developed and maintained by Microsoft (DIXF)?

sir , i don’t know how to use dIxf.

Okay, but this problem should be fixed by learning DIXF instead of writing code.

The Data Import Export Framework (DIXF) can export and import data in various formats. It does it in two steps:

  • It uses SSIS to handle the particular formats, which is usually much more efficient than processing files line by line in code. Speaking of import, the data transformed by SSIS get stored to staging tables in AX database.
  • The other step handles AX inner working. It maps the flat staging records to actual tables in database (one entity may be represented by several tables), including things like table inheritance. It also executes validation logic and things like that.

The documentation starts here.

sir , how to do this through code import and export sales order