Finding the id of the element using IE Developer tool.


With IE Developer Tool, to find the id, we need to do the following

Select developer tools and

clip_image001

then “select element by click” in find menu of dev tool.

clip_image002

And then select the element whose id we want

clip_image003

The id would be within the Li element within the attributes tab, select it

clip_image004

 

That’s  it ..

Consuming CurrencyConverter web service through JavaScript


Hi,

For getting the currency conversion rate we could use the following web service provided by Generic Objects Technologies Ltd.

Check out the web services provided by them

http://www.webservicex.net/WCF/webServices.aspx

To consume their currency converter web service

http://www.webservicex.net/CurrencyConvertor.asmx we could use the following JavaScript code

var xmlHttp;
function SoapCall() {
// creatng the xmlHttp object
xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);
// Calling the web service using post and true means asynchronous call
xmlHttp.open(“post”, “http://www.webservicex.net/CurrencyConvertor.asmx”, false);
// Setting the request header to let the web service identify the soap request we would be sending

xmlHttp.setRequestHeader(“Content-Type”, “text/xml; charset=utf-8”);

xmlHttp.setRequestHeader(“SOAPAction”, “http://www.webserviceX.NET/ConversionRate”);

var soapRequest = “<?xml version=’1.0′ encoding=’utf-8′?> ” +
“<soap12:Envelope xmlns:xsi=’http://www.w3.org/2001/XMLSchema-instance&#8217; xmlns:xsd=’http://www.w3.org/2001/XMLSchema&#8217; xmlns:soap12=’http://www.w3.org/2003/05/soap-envelope’>&#8221; +
” <soap12:Body>” +
”   <ConversionRate xmlns=’http://www.webserviceX.NET/’>&#8221; +
”     <FromCurrency>USD</FromCurrency>” +
”    <ToCurrency>INR</ToCurrency>” +
”  </ConversionRate>” +
“</soap12:Body>” +
“</soap12:Envelope>”;

xmlHttp.send(soapRequest);
alert(xmlHttp.responseText);

}


Bye..

Managing JavaScript Code in CRM


Hi,

Most of the time while writing JavaScript in CRM, we end up writing duplicate code i.e.

For e.g. if there are two fields say field1 and field2  and on selection of a particular value in field1,  we would like to make field2 mandatory.

Here we would first write the code for that in the onSave event of the field1.

Than again we would have to put the same code in the onload event also to reflect the same condition.

After some time it becomes really difficult to maintain it!

However there is a solution to that, just browsing through stunnware site, got this particular article on reusing Javascript.

Please go through that !!

Reusing code in OnLoad and OnChange event handlers

Just thought of sharing it ….


Cancelling OnSave event CRM JavaScript.


Hi,

To cancel save event we need to use this line of code

event.returnValue=false;

followed by

return false;

To know more about it

http://msdn.microsoft.com/en-us/library/cc150868.aspx

To understand difference between event.returnValue=false and return false, check out this informative article

http://webdevelopersjournal.com/articles/jsevents2/jsevents2.html

Bye..

JavaScript on click of Finish Button in Survey – SharePoint


Hi,

We had created a survey and wanted some message to appear when user clicks on finish button.

Through one of my colleague i came to know about this function — PreSaveAction

function PreSaveAction()
{
alert(“Thanks for the participating in the survey!”);
return true;
}

Placing the above function in the newform.aspx using SharePoint designer  did the trick.

We could use the PreSaveAction function for custom validation as well !

http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html

Bye..

CrmSecurityException: Could not find GUID for server — servername


Hi,

I was getting the following error “Invalid domain name. Domain name is either invalid or unreachable” while trying to register a plugin.

Found this kb article

http://support.microsoft.com/kb/948593/EN-US/

So installed update rollup 4.0

http://www.microsoft.com/downloads/details.aspx?FamilyID=0ddf8e83-5d9c-4fe7-9ae6-f2713a024071&displaylang=en

After that on trying to open CRM started getting the could not find GUID error.

Not very sure, but it has something to do with ActiveDirectory i guess.

Anyways uninstalled the Rollup 4 and to my surprise everything started working normally, even i was able to register plugin without any issues!!

Just thought of sharing the same !!

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓