Tuesday, January 20, 2015

Show only Time for Date Time Attribute

In CRM you can show only Date part of date time attribute, but not only time.

To show only date part of date time attribute, you need to go field customization and change Format as Date. 


You can show only time for date time attribute either by modifying CRM entity form HTML using Javascript or by adding web resource.

Modifying CRM form HTML (DOM) is not supported, so I will go with web resource.

1.       Add HTML web resource on your form.
2.       Set HTML web resource properties like, Number of rows, scrolling border, formatting etc.
3.       Add web resource on your form, This HTML web resource should be look like attribute on Form, so set properties accordingly.
4.       Add Jquery latest library in your entity form libraries.

5.       Add Following code into you HTML web resource. 


1.       Change < script type="text/javascript" src="new_jquery_1.10.2.js" > < /script >  as per your JQuery library name.
2.       Hide your date field on form.
3.       Save and publish customization.

Here is your output


Friday, January 16, 2015

Convert Dropdown / Pick list /Option set into Radio button list for CRM

In CRM we don't have option to show picklist / option set as a radio button. we can show radio buttons/ check box / drop down for boolean attirbute but not for option set.

If you want to show option set as radio button list we can achieve this by adding one HTML web resource and some Jquery code..

Here are steps to convert Option set into radio button list.

1. Create HTML web resource and give proper name

2. Add following code in your HTML web resource 



3. As I am using Jquery functions in this HTML web resource, so we need to add Jquery library.

<  script type="text/javascript" src="new_jquery_1.10.2" > < / script >

If you are using folder structure for web resources name like new_JavaScript/jquery_1.10.2.js

then reference library like
<  script type="text/javascript" src="../new_JavaScript/jquery_1.10.2.js" > < / script >

4.  In HTML web resource I am using  option set attribute name "new_radiobuttongroup", and to get option set values & Text from CRM form I am using

var dropdownOptions = parent.Xrm.Page.getAttribute("new_radiobuttongroup").getOptions();


5. Save HTML web resource, and open Entity form where you want to convert option set to radio button. 

6. Add Jquery library which we used in HTML web resource in form library.



6.  Add above created web resource on form. and set web resource properties as shown


You can set number or rows depending on your number of option set options. 

7. Add your option set attribute on form which you want to show as radio button list. and set 
Visible by default property to false.


your form will look like




8.  Save and publish your customization. 

Now here is option set shown as radio button list..






Tuesday, January 13, 2015

CRM View custom Column width



For CRM view we can specify column width as


but sometime this width is not exactly matching with customer requirement.. Sometime we need one column width more than 300px.. but in the UI showing maximum 300 px width.



In this case we can easily increase / decrease column width.. but we need to follow some simple steps as follows

1. Export entity customization solution.
2. Open customization.xml file text/ xml / visual studio.
3.  Look for SavedQueries tag in xml for your entity.
4.  Insided SavedQueries you will see saved query for each view like Active, Inactive, Quick find, Advanced find etc. I am using Inactive view saved Query.



5. Column width is specified in layoutxml tag.
6. We need to modify only below section



7.  Change width of column as per requirement.



8. Save customization.xml file
9. Import your solution file to CRM.
10. Publish your customization.. and now you will see the view columns with different width.