tag:blogger.com,1999:blog-7483666954520465023.post1258312351158110633..comments2024-03-27T08:10:41.737+00:00Comments on Microsoft Azure & Dynamics 365 CRM -Learn The Ropes: How to set focus on a control in CRM 2011 using JavascriptD. MANJALYhttp://www.blogger.com/profile/16122189495637340566noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-7483666954520465023.post-58359853957243952362014-04-09T13:23:53.293+01:002014-04-09T13:23:53.293+01:00Use below code its working.
document.getElementByI...Use below code its working.<br />document.getElementById("crmForm").setAttribute("setinitialfocus", false);<br />Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);<br /><br /><br />Anonymoushttps://www.blogger.com/profile/02021909376785512214noreply@blogger.comtag:blogger.com,1999:blog-7483666954520465023.post-47189172311546337402014-02-26T11:07:09.663+00:002014-02-26T11:07:09.663+00:00did any one know how to set focus in a lookup fiel...did any one know how to set focus in a lookup fieldkchttps://www.blogger.com/profile/03717411841537429959noreply@blogger.comtag:blogger.com,1999:blog-7483666954520465023.post-68610018001647836052014-01-17T06:01:12.105+00:002014-01-17T06:01:12.105+00:00Thanks Its working Thanks Its working Anonymoushttps://www.blogger.com/profile/01325101280967384920noreply@blogger.comtag:blogger.com,1999:blog-7483666954520465023.post-18724512007753044122013-07-22T08:11:10.455+01:002013-07-22T08:11:10.455+01:00Manjaly,
Even this didn't worked for me.
But ...Manjaly, <br />Even this didn't worked for me.<br />But got another work around which helped in my case. <br />Set the focus to another control first and then to the control really u need to setFocus, as below.<br />Xrm.Page.getControl("name").setFocus(true);<br />Xrm.Page.getControl("TheFieldYouReallyWantToFocus").setFocus(true);<br /><br />For your reference the link is this. http://stackoverflow.com/questions/2684646/setting-field-focus-after-javascript-alert-not-working-in-ms-crm <br />Renjith Phttps://www.blogger.com/profile/05637493134397705488noreply@blogger.comtag:blogger.com,1999:blog-7483666954520465023.post-26336557761405819132011-10-25T06:39:32.756+01:002011-10-25T06:39:32.756+01:00Hi Sergio,
For onchange event its a bit different...Hi Sergio, <br />For onchange event its a bit different. Pls try the following.<br />Pass the context from the onchange event of the field and then<br /><br />Xrm.Page.getControl(context.getEventSource().getName()).SetFocus(true);D. MANJALYhttps://www.blogger.com/profile/16122189495637340566noreply@blogger.comtag:blogger.com,1999:blog-7483666954520465023.post-66377052166813685872011-10-24T23:54:16.359+01:002011-10-24T23:54:16.359+01:00Hi, i´m usign this section of code on OnChange eve...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.<br /><br />thanks in advanced!sergiohttps://www.blogger.com/profile/06181960338605318591noreply@blogger.com