Monday, August 13, 2012

Dependent Optionlist/Picklist values in CRM 2011

This is not possible with OOTB CRM features. We can use lookup options with cascading features from OOTB functions.

So is there a way to come around this? Yes, there is. There is a solution which has been created and shared among the developers. This is perfect when it comes to CRM interfaces.

The links below would take you to articles which describe it more.
http://blogs.msdn.com/b/paf/archive/2011/04/21/how-to-easily-create-dependent-picklist-in-crm-2011.aspx

The recurring problems have been included in this article.
http://blogs.msdn.com/b/paf/archive/2011/09/29/dependent-picklist-recurrent-problems.aspx

Please not you can have multiple picklist dependent on the same picklist in an entity. This is supported. All you have to do is to create a single web resource with all the mapping data inside it and it will work. 

If you have any issues doing the above let me know.

Thursday, August 9, 2012

CRM 2011 Integer fields and comma symbol

In CRM if you create an integer field by default the CRM group 2 numbers together by using a comma. This is the standard feature.

However sometimes customers ask this comma to be removed. This is not possible with OOTB functionality in CRM. You have couple of options.

•    Remove the integer field, have a text field and include javascripting to validate the field. This might be cumbersome.
•    Can create another field (text) and using a workflow assign the value of the integer field to this. This field would be getting displayed in views and forms. The drawback is you have synch both these fields.
•    You can have a javascript to remove the comma from the CRM form when it’s loading. Not much difficult. However you still would not be able to get rid of commas when you display a view.

Below I have given a common javascript function which can be used to get rid of commas. Add this to a web resource.


function RemoveComma(fieldname)
{
document.getElementById(fieldname).value = Xrm.Page.data.entity.attributes.get(fieldname).getValue();
}

•    Add the web resource to form onload event.
•    Call the function RemoveComma with the field name as the parameter.


This way you can use this function anywhere you want just by passing the field name to it.

Retrieving Calendar of a Bookable Resource in Dynamics

There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...