Asked by:
onfocus event of a lookup in crm 2011

Question
-
hi frnds,
Is it possible to fire a onfocus event for lookup in crm. i tried using onclick event but the i cant able to view lookup dialog box. Can any one suggest how to fire onfocus event of a lookup...
Thanx in advance...
Arun Kumar G
- Edited by Aronkumar Thursday, July 4, 2013 7:28 AM
Thursday, July 4, 2013 7:27 AM
All replies
-
try this:-
http://crmbusiness.wordpress.com/2011/05/19/crm-2011-how-to-set-focus-using-javascript/
Regards Faisal
Thursday, July 4, 2013 7:47 AM -
Dear Faisal,
Thanx u for ur answer but am not asking to set focus to a field i need to fire some event(function) when the lookup field get the focus..
Regards,
K.Karthikraja
Arun Kumar G
Thursday, July 4, 2013 7:53 AM -
Hi Arun,
There no OOB onfocus event is exposed for CRM fields, but you should be able to attach this event to your form controls.
control.
attachEvent('
onfocus',method);
but keep in mind this will be unsupported.
Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.Thursday, July 4, 2013 8:04 AMModerator -
add this code in your javascript file
and register ONLOAD function on load event of form.
function ONLOAD() {
document.getElementById('preferredlanguageid_ledit').onfocus=Onfucus;
}function Onfucus() {
alert('hi');
}
where preferredlanguageid is your field name
Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"
- Edited by Mr. Santosh Bhagat Thursday, July 4, 2013 9:08 AM update
Thursday, July 4, 2013 8:55 AM