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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Unlock fields in editable grid

(1) ShareShare
ReportReport
Posted on by 89
Hi,

Is it possible to make every field editable in editable grid? for example I have created a custom field and on the editable grid it shows as locked.
I have the same question (0)
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    Unlock fields in editable grid
    Hi Partner,
    Yes, this is by-design.
    There are certain restrictions on inline editing based on the type of products in the subgrid:
    - If the product in the subgrid is an individual product and an existing product from the product catalog, all fields except the Quantity and Discount are locked for editing.
    - If the product in the subgrid is an individual product and a write-in product from the product catalog, all fields except the Product Name, Quantity, and Discount are locked for editing.
    - If the product in the subgrid is a product bundle or an optional product of a bundle, all fields except Quantity and Discount are locked for editing.
    - If the product in the subgrid is a required product from an existing product bundle, all fields in the subgrid view are locked for editing.
  • John Mongol Profile Picture
    89 on at
    Unlock fields in editable grid
    My question is not about the design, but if its possible to make them not restricted somehow? 
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    Unlock fields in editable grid
    Hi John,
    Because it's by-design, it's impossible to change it.
    Perhaps you could add another editable sub-grid yourself, rather than using the OOB sub-grid, , then you can edit columns in the new subgrid:
  • Leah Ju Profile Picture
    Microsoft Employee on at
    Unlock fields in editable grid
    Hi Partner,
    Was my answer helpful? 
    If it was helpful, can you verify it?
    If you have any questions, please feel free to contact me.
    Regards,
    Leah
  • Suggested answer
    Community member Profile Picture
    8 on at
    Unlock fields in editable grid
    Hi John,
     
    This can be done with Javascript. 
    In your js file , copy this function :
     
    function lockUnlockFields(executionContext,fieldName,lockunlock) {
          var formContext = executionContext.getFormContext();
              let objEntity = formContext.data.entity;
              objEntity.attributes.forEach(function (attribute, i) {
                     if (attribute.getName() == fieldName) {
                        let attributeToDisable = attribute.controls.get(0);
                        attributeToDisable.setDisabled(lockunlock);
                     }
              });
    }
    Then, create a function to unlock a list of fields of your choice , for example :
     
    function unlockMyFields(executionContext)
    {
        var formContext = executionContext.getFormContext();
        
        var fieldNames = ['unit','discountpercentage'];//put here the logical names of the fields to unlock
        for(i=0;i < fieldNames.length;i++)
        {
            lockUnlockFields(executionContext,fieldNames[i],false);
        }
    }
    Now, you have to qo to the opportunity form , select the subgrid of the products and in the events tab , choose the event 'OnRecordSelect'  and put your function there (unlockMyFields).
     
    Regards,
     
    Mounir
     

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 101 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 57

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans