Skip to main content

Notifications

Announcements

No record found.

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.
  • 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
     
  • 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
    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:
  • 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 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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans