Link to home
Start Free TrialLog in
Avatar of apollo7
apollo7Flag for United States of America

asked on

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

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.

Thanks

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of apollo7

ASKER

Thank you, we will test this and get back with any questions.
Hi,

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

ASKER

This change event solved the problem