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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to export a text file in read only through x++

(0) ShareShare
ReportReport
Posted on by 4

I am new to ax.

i want export a file to read only how can i achieve that any one guide me.

and don't want convert into pdf.  

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Could you describe your business requirement?

    Text files can always be edited, but you can restrict who can edit it.

    My suggestion is to export the file normally without any tricks, and just place it in a folder where your users have only read access. This way it's "read only" for them. But of course they can still copy it on their workstation and edit the copy.

    PDF is often useful for distributing documents that should not be edited, because normally it can't be edited. But even then it's possible by using software that supports editing PDFs.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    By the way, which version of AX are you talking about?

  • Siddy Mujumdar Profile Picture
    4 on at

    i am using d365 fo

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Moved from Dynamics AX forum to Dynamics 365 Finance forum.

  • Suggested answer
    Fangyuan Hou Profile Picture
    on at

    Hi Siddy Mujumda,

    You can set the property IsReadOnly to true to make the file as read only after you save the file.

    https://docs.microsoft.com/en-us/dotnet/api/system.io.fileinfo.isreadonly?view=netcore-3.1

    System.IO.FileInfo fileInfo = new System.IO.FileInfo(sourceFile);
    fileInfo.IsReadOnly = true;
  • Suggested answer
    Rahul Mohta Profile Picture
    21,032 on at

    could also have tried to export data using data management rather than writing code if a data entity exists

  • vinitgoyal2005 Profile Picture
    6,332 on at

    Hi Siddy,

    What is the requirement here? What data are you exporting form D365FO? What format are you looking to export? Let us know more details so we can help you.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans