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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to make only 1 fie...
Finance forum
Unanswered

How to make only 1 field in the table as editable by code?

(1) ShareShare
ReportReport
Posted on by 252
 Hi,

In SalesLine grid, is it possible to make the whole record as non editable based on a condition expect for 1 field?

I mean

If(salesLine.XField == noyes::yes)
{
   this.allowEdit(false); But except for FieldZ
}
 
I have the same question (0)
  • GirishS Profile Picture
    27,843 Moderator on at
    Hi,
     
    You can make use of the active or selectionChanged method at DataSource level, but if you set the DataSource allow edit to false it will disable that particular active record from editing. You cannot mention the exception fields here. 
    If you want, you need to particularly set all the fields that are to be editable and other fields that are to be non-editable.
     
    Thanks,
    Girish S.
  • Waed Ayyad Profile Picture
    9,212 Super User 2026 Season 2 on at
    Hi,
     
    You can add your code on the active method on form DataSource.
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     
     
     
  • Adrian Pahomi Profile Picture
    4 on at
    Hi, 
    Using allow edit false on the datasource level can't be undone for specific fields.
    You have to iterate over all the fields on the datasource and set them to AllowEdit = false/ true. 
    Check this https://community.dynamics.com/forums/thread/details/?threadid=e8f6cbbd-eaa9-467d-ac41-0bca2d26cdc5
  • Waed Ayyad Profile Picture
    9,212 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans