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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to Get contact information on mobile number in phone call Form in dynamic crm using javascript

(0) ShareShare
ReportReport
Posted on by 150

hello everyone , 
        i want when i enter mobile number in a text box and on pressing enter it show me contact details of that mobile number in phon call form.

here is snapshot in below link

please help thanks in advance.
https://www.screencast.com/t/qhg1T0JdqDHB

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: How to Get contact information on mobile number in phone call Form in dynamic crm using javascript

    Hi

    Try using xrm.webapi

    docs.microsoft.com/.../retrievemultiplerecords

  • Suggested answer
    aaaaaaaaaaaaa Profile Picture
    10 on at
    RE: How to Get contact information on mobile number in phone call Form in dynamic crm using javascript

    I am stuck in the same situation can you help me to find a solution and did the JS code above work well according to your needs

  • Razim Khan Profile Picture
    150 on at
    RE: How to Get contact information on mobile number in phone call Form in dynamic crm using javascript

    thanks @Thomas Dayman

  • Suggested answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: How to Get contact information on mobile number in phone call Form in dynamic crm using javascript

    Hi Razim,

    You could write some JavaScript to achieve this.

    Download the CRM Rest Builder https://crmrestbuilder.codeplex.com/ You can generate your code by using this.

    Then place this code to your 'mobile' field as an onChange. The code would look something like this:

    
    function getContact()
    	{
    		var mobile = Xrm.Page.getAttribute("test_mobilenumber").getValue();
    		if (mobile != null)
    		{
    			SDK.REST.retrieveRecord(
    			mobile[0].id,
    				"test_mobile",
    				"test_contact",
    			null,
    
    			function (mobile)
    			{
    				var lookup = new Array();
    				lookup[0] = new Object();
    				lookup[0].id = test_mobile.test_contact.Id;
    				lookup[0].name = test_mobile.test_contact.Name;
    				lookup[0].entityType = "Contact";
    				Xrm.Page.getAttribute("from").setValue(lookup);
    			},
    			errorHandler);
    		}
    	}
    
    	function errorHandler(error)
    	{
    		alert(error.message);
    	}


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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans