I had to check that some attribute isn't empty after the user click on ribbon button.
I've register the ribbon button event to something like:
if(Xrm.Page.getAttribute("new_test").getValue() != null)
{
alert("aaaaa");
}
1) User clicks the ribbon button when the attribute is empty
2) Get's alert
3) User insert text to the attribute and clicks again
3) Get's alert
I've found that if the user isn't getting out (clicks out side) of the attribute's textbox the value remains the old value (in this case empty) but if he does It works.
After changing the code to the old (CRM 4) javascript syntact somethig like:
if(crmForm.all.new_test.DataValue != null)
{
alert("AAAA");
}
Everything worked great! Even if the user didn't get out of the textbox focus.
Is it a bug? is there a workaround?
Waiting for an answer.
*This post is locked for comments
I have the same question (0)