Question

I have a custom entity in CRM 2011 with a Closure Code(drop down list) and Solution(multiple lines text) fields.

Is weird what is happening, and this is that the next sentence, is not getting the actual field value:

var detailsSet = Xrm.Page.getAttribute("aux_solution").getValue();

Why this could happen?

Was it helpful?

Solution

As explained in the comments, my problem was that the field wasn't taking the actual value because the focus was on it. Moving to another field before checking the values is how I solve this. I hope could help someone.

OTHER TIPS

That is because the object model does not get refreshed data while you have focus on the field. If you want to get the value without having to click outside you need to use the good old document.getElementById .

If it is an option set, you should use eiter getSelectedOption() or getText()

so try

var detailsSet = Xrm.Page.getAttribute("aux_solution").getText();

For more details refer this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top