Showing posts with label Date Time. Show all posts
Showing posts with label Date Time. Show all posts

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