Hi, i´m usign this section of code on OnChange event in my customize field, but it does not work, do you have ideas? i tried different lines of code but none of them work for me.
Manjaly, Even this didn't worked for me. But got another work around which helped in my case. Set the focus to another control first and then to the control really u need to setFocus, as below. Xrm.Page.getControl("name").setFocus(true); Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);
For your reference the link is this. http://stackoverflow.com/questions/2684646/setting-field-focus-after-javascript-alert-not-working-in-ms-crm
Use below code its working. document.getElementById("crmForm").setAttribute("setinitialfocus", false); Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);
Hi, i´m usign this section of code on OnChange event in my customize field, but it does not work, do you have ideas? i tried different lines of code but none of them work for me.
ReplyDeletethanks in advanced!
Hi Sergio,
ReplyDeleteFor onchange event its a bit different. Pls try the following.
Pass the context from the onchange event of the field and then
Xrm.Page.getControl(context.getEventSource().getName()).SetFocus(true);
Manjaly,
ReplyDeleteEven this didn't worked for me.
But got another work around which helped in my case.
Set the focus to another control first and then to the control really u need to setFocus, as below.
Xrm.Page.getControl("name").setFocus(true);
Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);
For your reference the link is this. http://stackoverflow.com/questions/2684646/setting-field-focus-after-javascript-alert-not-working-in-ms-crm
Thanks Its working
DeleteUse below code its working.
Deletedocument.getElementById("crmForm").setAttribute("setinitialfocus", false);
Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);
did any one know how to set focus in a lookup field
ReplyDelete