问题
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?
回答1:
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.
回答2:
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 .
回答3:
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
来源:https://stackoverflow.com/questions/14561802/xrm-page-getattribute-getvalue-dont-get-actual-value