Jun 25, 2014

Issue in setFocus in forms of CRM 2011

After spending some frustrating time I found a native CRM 2011 issue. When I try to set focus to a lookup field onload of form, it just doesnt work.

What I observed was it jumps to the expected field, but switches back to some other field in the top of the form in no time.

Then I found below fix.. thought of sharing here;

function onLoad() {
   window.setTimeout(focusFromField,100)
}

function focusFromField() {
  var _Control = Xrm.Page.ui.controls.get("new_officeid");
  _Control.setFocus();
}

Also learned this issue is fixed in CRM 2013.

No comments:

Post a Comment