Category Archives: MS CRM & Javascript

Rearrange Navigation Items in Left Navigation Bar

Some time we need to rearrange left navigation item of left navigation bar, we can do this easily using JS “insertBefore()” function. Just we need to get element id of the left navigation items. We can use IE dev toolbar to do this; also if you are using IE 8 then IE dev toolbar will not work, as Microsoft has… Read more »

Calling External WebService using JS

 Sometimes we need to call External webservice using JS, i have written a function to call external webservice Here is the function, you can modify it according to your requirements function CallCustomWebService(FunctionName, ParameterNameList, ParameterValueList, ProxyURL) {//FunctionName-Name of the function to call //ParameterNameList-Array of Parameter names in your proxy function //ParameterValueList-Array of Parameter value //ProxyURL-URL of your proxy var CallingFunctionURL = “http://tempuri.org/”… Read more »

Tooltip For MS CRM Fields

The easiest way to provide tooltip for crm fields are to use “title” . for example to provide tooltip for accountnumber in account entity just paste following code on formload of account entity crmForm.all.accountnumber.title=”account number used in correspondence about the account”; you can also provide tooltip for lables. Done, But Remember this unsupported

Get Production Information Based on ProductID

 Most of the time i found this question on microsoft forum to get product information based on productid. I have develped this code for the same requirement. You can just paste this code on the onchange event of the product lookup. You just need to chage field names accordingly. __________________________________________________ GetProductInformation(); function GetProductInformation() { var resultXml; var errorCount; var msg;… Read more »

Hide Custom button through JS

Today i got requirement to hide my custom button, i  just picked it’s id with the help of IE developer toolbar and used easiest line to hide any control document.getElementById(‘ISV_New_13_ServiceActivity’).style.display=’none’; and just publised my entity and started testing it but soon after that i started rubbing my head  :-/  as i got JS error, then i test it using alert and found… Read more »

Hide 'Add Existing…' Button

I just got the requirement to hide ‘Add existing button’ from the associated view’s toolbar.  Thanks to Dave for his post at http://blog.davehawes.com/page/Remove-Add-Existing-xxxxx-to-this-record-button-version-1.aspx i did some modification and it worked for me. Just remember to call ‘HideAssociatedViewButtons’ with proper arguments, it takes two argument first ID of the link in left navigation area and second is the title of that… Read more »

Call crm webservice through Javascript

Most of the time developer need to call crm webservice or external webservice through javascript, here is the code to call crm webservice through javascript.  var sEntityName=”nameofentity”;  var xml = “<?xml version=”1.0″ encoding=”utf-8″?>” +             “<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema“>” + GenerateAuthenticationHeader() +             ” <soap:Body>” +             ” <RetrieveMultiple xmlns=”http://schemas.microsoft.com/crm/2007/WebServices“>” +             ” <query xmlns:q1=”http://schemas.microsoft.com/crm/2006/Query” xsi:type=”q1:QueryExpression”>” +             ” <q1:EntityName>”… Read more »

Open new window on some event

i was just trying to open new service activity window on some event  & and after that i was trying to set customers according to the parent contact id i was just trying with window.open(‘/activities/serviceappointment/edit.aspx’); and i write following code to access paraent contactid look on form load event of service activity window. // to create lookup array var customer_lookup=new Array(); //… Read more »