Check for updates: how to download and install a new version of your C# application

http://themech.net/2008/09/check-for-updates-how-to-download-and-install-a-new-version-of-your-csharp-application/

Display Time picklist in Dynamics Crm 4.0

Here I am putting the javascript code for display the Time Dropdown/Picklist on form.

I will attacheed the screens later

//code inserted here by ali usman dec 5 to have the time in 1 minute interval
SetDateTime = function (dateField)
{
//Check the existence of the datetime field. It may not be included in a quick create form!
if (dateField != null)
{
var timeField = dateField.all.time;
//Check the existence of the time field. It is null if the control is setup to only display the date.
if (timeField != null)
{
//The new interval in minutes.
var interval = 1;
var tables = timeField.getElementsByTagName(“table”);
if ((tables != null) && (tables.length > 0))
{
var table = tables[1];
//Remove all existing values from the selection box while (table.firstChild != null)
{
table.removeChild(table.firstChild);
}
//Add the new values
for (hour = 0; hour < 24; hour++)
{
for (min = 0; min < 60; min += interval)
{
var row = table.insertRow();
var cell = row.insertCell();
var time = ((hour < 10) ? "0" : "") + hour + ":" + ((min < 10) ? "0" : "") + min;
cell.setAttribute("val", time);
cell.innerText = time;
}
}
}
}
}
}
//Changing the time interval in date/time fields
//The time selection box of a date/time field uses a 30 minute interval. You can change it to a different
//interval using the following code in an OnLoad event:

var occurenceDateTimeField = crmForm.all.new_occurencedateandtime;

SetDateTime(occurenceDateTimeField);

Change the Left Naviation Item on Form in Dynamics CRM 4.0

Today, I got the requirement for changing the Letf Naviation item on Form in Dynamics CRM 4.0

By default, it will display ‘Information’ but we have to change the ‘Initial Case’

for that, Here I am developed the JavaScript.
Form, OnLoad Event
function leftNavRename(leftNav, oldName, newName)
{
var navItem = document.getElementById(leftNav);
if(navItem != null)
{
navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);
navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);
}
}

// Rename Information to Inital Case
leftNavRename(‘navInfo’,'Information’,'Initial Case’);

The best Ribbon Editor Tool for CRM 2011

This is the best ribbon Editor tool for Dynamics CRM 2011

http://erikpool.blogspot.com/2011/10/new-crm-2011-ribbon-editing-tool.html

http://erikpool.blogspot.com/2011/10/understanding-crm-ribbon-xml-part-3.html

Hide a Default buttons Collaborate,Process and Data group from Contact Entity in CRM 2011

Hides from Grid

Hides from form

Load external Javascript in Dynamics CRM

Here is the code to load the external javascript (.js file) in dynamics CRM 4.0.

On Case entity –> form property –> On load

var script = document.createElement(‘script’);
script.language = ‘javascript’;
script.src = “/ISV/JS/JavascriptFolder/CaseOnLoadOnSaveMod.js”;
document.getElementsByTagName(‘head’)[0].appendChild(script);
var f = function()
{
if (event.srcElement.readyState == “loaded” || event.srcElement.readyState == “complete”)
//displaymessage();
CaseOnLoad();
}
script.attachEvent(“onreadystatechange”, f);

Writing JavaScript inside ISV.Config file

JavaScript in ISVJavaScript in ISVIn ISV.config JavaScript code can be written as contents of the JavaScript attribute within the button or menuitem elements.
Certain characters of JavaScript code are not valid in ISV.config. These characters needed to encode for use in ISV.Config.

Following is the list of characters and their encoding.

Get parent list in Dynamics CRM 4.0 where parent id is null using javascript


// Define URL to CRM API service
var serverUrl = "/mscrmservices/2007/crmservice.asmx";

// Set up XMLHTTP request
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", serverUrl, false);
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")

// Specify correct SOAP action in the header
xmlhttp.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");

// Define the execute message
var message =
[
"<?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>subject</q1:EntityName>",
"<q1:ColumnSet xsi:type=\"q1:ColumnSet\" >",
"<q1:Attributes>",
"<q1:Attribute>subjectid</q1:Attribute>",
"<q1:Attribute>title</q1:Attribute>",
"</q1:Attributes>",
"</q1:ColumnSet>",
"<q1:Criteria>",
"<q1:FilterOperator >And</q1:FilterOperator>",
"<q1:Conditions>",
"<q1:Condition>",
"<q1:AttributeName >parentsubject</q1:AttributeName>",
"<q1:Operator>Null</q1:Operator>",
"</q1:Condition>",
"</q1:Conditions>",
"</q1:Criteria>",
"</query>",
"</RetrieveMultiple>",
"</soap:Body>",
"</soap:Envelope>"
].join("");

].join("");

// Submit to the CRM API web service and receive a response
xmlhttp.send(message);
var result = xmlhttp.responseXML.xml;

// Create a new DOM document and load the response XML
var doc = new ActiveXObject("MSXML2.DOMDocument");
doc.async = false;
doc.loadXML(result);

var nodeslst = doc.selectNodes("//BusinessEntity");
//alert(nodeslst.length);
alert(result);

var iLoop = 0;
for(iLoop =0; iLoop " + nodeslst[iLoop].childNodes[1].text );
}

Dynamic Picklist

http://blogs.msdn.com/b/dynamicscrmonline/archive/2009/05/01/dynamic-pick-list-from-a-custom-entity-in-dynamics-crm-online.aspx

Learn Creating Dynamics CRM Plug-in Development and Deployment

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

Follow

Get every new post delivered to your Inbox.