web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Mouse down event on text field in Javascript

(0) ShareShare
ReportReport
Posted on by 6,211

Hi All,

I want to open lookup dialogue when i click inside text field,

with the below code i am able to open lookup dialogue on change of text field but i want it on mouse down event that is when i click on text field in dynamics crm.

function OpenLookup() { 

var customServerURL = document.location.protocol + "//" + document.location.host;
var objectCode = "2";
var url = customServerURL + "/_controls/lookup/lookupsingle.aspx?class=null&objecttypes=" + objectCode + "&browse=0&ShowNewButton=0&ShowPropButton=1&DefaultType=0";
var lookUp = window.open(url, "entity", "width=500,resizable=1,height=400,menubar=0,status=1,location=0,toolbar=0,scrollbars=1");
}

thanks,

Shahbaaz

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at

    hi Ansari,

    you need to use jquery for the mousedown event inside JS. Please follow the below JQuery method how to do and Make sure to add the JQuery library to the form as well.

    api.jquery.com/mousedown

    hope this helps

  • Shahbaaz Ansari Profile Picture
    6,211 on at

    thanks for the reply hanifa, i know that but code you provide me with some code that how to use in crm

  • Syed Ibrahim Profile Picture
    6,257 on at

    Pls follow the below code sample.

    blogs.msdn.microsoft.com/.../using-jquery-in-web-resources

    https://community.dynamics.com/crm/b/develop1/archive/2013/08/08/jquery-and-jquery-ui-with-dynamics-crm-2011-amp-2013

    Hope this helps

  • Suggested answer
    chauhanhardik Profile Picture
    687 on at

    Hi Shahbaaz,

    I'm not sure about the mouse down event in crm, but "onmouseenter" and "onmouseout" events are there, u can refer below link for the same,

    social.microsoft.com/.../simple-onclick-event-help-crm-2011-jscript

    Please try to implement as shown below,

    Xrm.Page.getControl("fieldSchemaName").mousedown(function() { your code here; });

    Thanks,

    Harry

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans