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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Unlock fields in editable grid

(1) ShareShare
ReportReport
Posted on by 91
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
    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
    91 on at
    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
    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
    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
    CU27040929-1 Profile Picture
    8 on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 94 Super User 2026 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 68 Most Valuable Professional

#3
ParthPatel249 Profile Picture

ParthPatel249 62

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans