Tag Archives: Microsoft Dynamics CRM 4.0

A simple “day of the week” script

Some months ago a customer asked us if it was possible to prevent users from selecting a Saturday or Sunday in a date field. Here is a simple function you can use to call the selected day of the week. You can customize it to suit your own wishes. Please remember that Sunday is 0 and Saturday is 6.

Happy Easter!

function weekday () {
//Script to show which weekday the selected date is.
//Sunday = 0, Saturday = 6
//Script to be called during Onchange event

/* CRM 3.0 & 4.0 */ selectedDate = crmForm.all.estimatedclosedate.DataValue;
/* CRM 2011 */ selectedDate = Xrm.Page.data.entity.attributes.get("estimatedclosedate");
var weekday = selectedDate.getDay();
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

alert("You have selected a " + dayNames[weekday]);
}
Tagged as: , , ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (2 votes, average: 6.00 out of 7)
Loading ... Loading ...

CRM 4.0 Sitemap – ShowGroups=”true”

For a CRM 4.0 implementation at one of our clients we had to create a lot of custom entities. Since we wanted to improve the usability for the users, we decided to customize the sitemap. With the help of the SDK SiteMap Overview (http://msdn.microsoft.com/en-us/library/cc150833.aspx) and the related subjects, a nice layout was constructed.

However the sitemap did not work… :-(

Having checked the XML over and over again, and even asking a Microsoft consultant for advice (who happened to be in the same room) I was lost.

It turned out that the “ShowGroups” attribute needed to be set in the Area Element. It is described in the SDK (http://msdn.microsoft.com/en-us/library/cc150877.aspx), but we totally forgot.

So when customizing the Sitemap, remember to set the ShowGroups to ‘true’, it can save you a lot of frustrations.

<Area ResourceId=”Area_Sales” Icon=”/_imgs/sales_24x24.gif” DescriptionResourceId=”Sales_Description” ShowGroups=”true”>

Tagged as: ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (2 votes, average: 5.00 out of 7)
Loading ... Loading ...

ISV button with onLoad function

It took me too long to figure out how to put my extensive JavaScript code into the ISV.config xml. Eventually it worked, but a far more easier way is to trigger the JavaScript, is to put a function name in the xml file and put the contents of the function in the onLoad of your form. As I reminder to myself, I stored it over here.
(In case the ISV button is not placed on the a form, but for example on a view, than you still have to put the JavaScript into the xml file.)
Here is a xml example of the ISV.config part:
XML code
And the onLoad script example:

Function_onclick = function()
{
alert('Button has been clicked');
}
Tagged as: , ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (1 votes, average: 3.00 out of 7)
Loading ... Loading ...
Page 1 of 812345...Last »
  • Recent Posts

  • Ratings

  • Archive

  • Admin

  • Cloud

  • Microsoft Certified Professional

  • About & Contact