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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Code to set allow edit to no

(1) ShareShare
ReportReport
Posted on by
Write a code to allow edit - no in d365fo
 
I have the same question (0)
  • Martin Dráb Profile Picture
    238,743 Most Valuable Professional on at
    Hi, I fixed the title of your thread and moved it to the correct forum.
     
    Now please tell us more about your situation, so we can give you the right solution. I understand it's about AllowEdit property, but it's not clear which object you have in mind (e.g. a form data source, a data source field, an unbound control, a dialog field...).
  • Community member Profile Picture
    2 on at
    To allow or prevent editing in Dynamics 365 Finance and Operations (D365FO), you can utilize form control methods to manage the editable property of specific fields. Here is an example of how you can achieve this in X++ code:
    public void modifiedField()
    {
        FormDataSource   fds = this.dataSource();
        FormDataSource   fdsTable = fds.cursor();
    
        // Set the allowEdit property to true or false as needed
        fdsTable.object(fieldNum(Table, Field)).allowEdit(!yourCondition);
    }
    
    Replace "Table" and "Field" with the appropriate table and field names that you want to control the editing for. Additionally, modify "yourCondition" with your specific condition that determines whether editing is allowed or not.
    Make sure to incorporate this code in the appropriate method within the form, such as the init method or the modifiedField method, depending on your specific requirements.
    This code allows you to control the edit permissions dynamically based on certain conditions or criteria that you define. Adjust the conditions as necessary to meet your specific use case in D365FO.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 583 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 378

#3
Diego Mancassola Profile Picture

Diego Mancassola 255

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans