Check this post. Provides an useful example: http://nishantrana.wordpress.com/2010/11/04/adding-my-first-custom-button-in-crm-2011/
Category: CRM 2011
Format date fields in CRM
Special thanks to Andriy a33ik Butenko for this post. // Formats the date into a certain format Date.prototype.Format = function(format) { var d = this; var f = “”; f = f + format.replace( /dd|mm|yyyy|MM|hh|ss|ms|APM|s|/|-|,|./ig , function match() { switch(arguments[0]) { case “dd”: var dd = d.getDate(); return (dd < 10)? "0" + dd :… Continue reading Format date fields in CRM
CRM Usage Report
A very nice thread about this issue, written by David Jennaway – MVP, can be found here.
Create a custom filtered lookup view in runtime – CRM 2011
Starting CRM 2011 you can filter a certain lookup view based on related entities or other system/custom views. But sometimes this is not enough. For example, if you wanna make a custom filtered view, that uses several filters, you can use the following approach. Starting scenario (all of the completed lookup fields will be used… Continue reading Create a custom filtered lookup view in runtime – CRM 2011
Creating records in CRM 2011 using JavaScript
Using the CRM Web Service, you can create new entity records, just using JavaScript. The following code demonstrates this: // Make Struct function MakeStruct(names) { var names = names.split(‘ ‘); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } } return constructor; }… Continue reading Creating records in CRM 2011 using JavaScript
Microsoft Dynamics CRM 2011 Online Global Availability
Microsoft Dynamics CRM 2011 goes international: 40 countries, 41 languages. Click here for more details.
Set a lookup value in CRM 2011
// Sets the lookup value for a certain field function SetLookupValue(fieldName, id, name, entityType) { if(fieldName != null) { var lookupValue = new Array(); lookupValue[0] = new Object(); lookupValue[0].id = id; lookupValue[0].name = name; lookupValue[0].entityType = entityType; Xrm.Page.getAttribute(fieldName).setValue(lookupValue); } }
CRM 2011 Custom Form Button
Using some of the basic DOM vs JavaScript capabilities, you can use the following code to dynamically generate a custom button for your CRM Form in Microsoft Dynamics CRM 2011 (scroll to the end of this post to see an example of how to use it). The button will look just like the ones in… Continue reading CRM 2011 Custom Form Button