Personalized Community is here!
Quickly customize your community to find the content you seek.
Latest TechTalk Videos
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Writing data from a program to a text file using any programming language is a very common task for the programmers. It is also used while you are customizing or developing a new solution in Microsoft ERP systems such as Microsoft Dynamics 365 for Finance & Operations but it is pretty difficult to find out the code as this is not a very common task in ERP development.
It can be used in writing error logs, event logs, or data of different processes to a file to ship that data to someone else who needs data in text file with TSV format. Moreover, there are many and many different requirements that can be fulfilled using this code. Keeping that in mind, I have created this tutorial. Few days back, we have discussed about how to read data from TSV file using x++ in D365FO.
//Moeen Ahmed Sultan
//Microsoft Dynamics 365 for Finance & Operations
//Tel: +92 321 458 9595
public static void main(Args _args)
fileName = "C:\\TSVDataFile.txt";
IOPermission = new FileIOPermission(fileName, #IO_APPEND);//If you want to write after deleting previous data, use #IO_WRITE instead of #IO_APPEND
file = new TextIo(filename, #IO_APPEND);//If you want to write after deleting previous data, use #IO_WRITE instead of #IO_APPEND
//It will create one tab separated row/line in the text file.
cont = connull();
cont = conins(cont, 1, "Moeen");
cont = conins(cont, 2, "Ahmed");
cont = conins(cont, 3, "Sultan");
Note: The disk partition of your computer should have allowed write permissions in order to run this code.
I have run this job three time and the text file is as follows:
Note: If you found any ambiguity or a better solution, please comment.
Data file: TSVDataFile – Output
GitHub: Click here
YouTube Channel: Click here
Strong people don’t put others down… They lift them up. ― Michael P. Watson
The post Writing data to TSV file using x++ in D365FO appeared first on NevoiTech Blog.
Business Applications communities