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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Nishant Rana’s Weblog / Calling Asp.NET web service...

Calling Asp.NET web service from form onLoad in CRM

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee

This is the code we can make use for calling ASP.NET webservice in form onLoad javascript event handler of our Entity in Microsoft CRM.

This example calls the simple Hello World service and assigns the value returned (i.e. “Hello World”) to a field in the entity form

xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);

xmlHttp.open(‘post’, ‘http://localhost/WebService1/Service1.asmx/HelloWorld’, false);

xmlHttp.send();

var xmlDoc=xmlHttp.responseXML;

var responseElement=xmlDoc.getElementsByTagName(“string”)[0];

var exch=responseElement.firstChild.nodeValue;

crmForm.all.address1_name.DataValue=exch ;

return false;

Check this link for more information

https://nishantrana.wordpress.com/2007/10/18/calling-aspnet-webservice-from-javascript-ajax/

Bye



This was originally posted here.

Comments

*This post is locked for comments