Need to to capture a grid column value, using the onchange event.

apollo7 used Ask the Experts™
Dynamics 365 8.2.3,

We are running Dynamics 365 8.2  and having an issue with editable grids.  When using the editable grid, XRM.Page is not supported so code to summarize grid data and update a field on the parent form only works when the form is Refreshed, not when the value is edited “in-line”.

I can make this work, but I need to to capture the grid column value, when changed on the “onchange” event.

According to the documentation I have found, the code examples seem to utilize Dynamics 365.  I’m not sure the Javascript we have supports the examples I have seeing online…specifically the “getFormContext”

Please review the code below and let me know what I need to change.


function pvalue(context) { 
    alert("here");  //this works
    var estimatedvalue = context.getFormContext().data.entity  // this does not
    var val = estimatedvalue.attribute.getByName("ring_estimatedvolume");

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Developer
Distinguished Expert 2018
but I need to capture the grid column value when changed on the “onchange” event.

Not sure but I think you need to attach a change event instead in you JS code like :

document.querySelector("[name='ring_estimatedvolume']").addEventListener('change', function(e){

Open in new window


Thank you, we will test this and get back with any questions.
Rikin ShahMicrosoft Dynamics CRM Consultant


Your code looks good and it should work. Can you specify your attribute is of which type?


This change event solved the problem

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial