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

Like
Report
*This post is locked for comments