Aug 22, 2011

Difference between completing and cancelling an appointment – part 1

In some business logics, it is required occurring some steps when an Appointment is closed. When I started coding it, to trigger a JavaScript, I made it happen in “onSave” event as usual. Eventually I found that it is needed to check exactly what the mode of “close Appointment”. Actually closing is the deactivating the record as we understand in CRM terms. So I could simply check relevant mode (i.e. 5). Then only I understood that I need more checking before proceeding. Not like any other entity, Appointment has another option of cancelling while closing. See below menu;

Hm... It’s obvious that you need to do your task only when completing, not cancelling. Here, trick is, you need to check “newStatusCode” code for that. That’s how you need to distinguish two cases. Below code will explain it well;

if (event.Mode == 5) //Deactivate Mode
   var status = document.getElementById('newStatusCode').value;
   if (status == 3) //Status for Completed
   if (status == 4) //Status for Cancel

Hope this is easy.

Please read Part2.

Aug 11, 2011

Convert Appointments in to Opportunities without source campaign

You can convert Appointments in to Opportunities in Dynamics CRM and it is a handy feature. You can simply click convert activity button which result below pop-up window.

Here, source campaign comes as a required field in default. Sometimes users doesn’t use campaigns and don’t wish to see it as a required field accordingly. If are asked to change this, there is no proper way of doing it. When I play around the page code, I found some way of doing it (unsupported). You can see the page in below location;

\Program Files\Microsoft Dynamics CRM\CRMWeb\Activities\act_dlgs\convert_activity.aspx

You just have to add two lines to onload script as below.

function window.onload()
cbLogResponse.checked = false; //added line 1
campaignCheckHandler();        //added line 2

Now source campaign is no more a required field by default.
Hope this will help you.

Aug 4, 2011

Changing the icons of default entities

Can we change the icons of default entities? Answer for this question is “No”. Don’t encourage anyone to do so. CRM 4.0 is not supporting this change. I tried to search web to find a way of doing it but failed to find a proper way. However, I managed to do a little experiment by myself to gather some information on this.

Actually entity icons for CRM 4.0 are stored in below location and they are in .GIF format.

Program Files\Microsoft Dynamics CRM\CRMWeb\_imgs\

Actually, I tried to play around with account entity. When I replace below image files, I could change the account icon in the application such as account grid and detail view of selected account.

ico_16_1 (size 16x16 pixels)
ico_16_1_d (size 16x16 pixels)
ico_18_1 (size 16x16 pixels)
ico_lrg_1 (size 66x48 pixels)

There is something tricky; this doesn’t change the icons (links) vertically lined in the left hand side navigation panel. You can see a long vertical stripe like images in below folder;

\Program Files\Microsoft Dynamics CRM\CRMWeb\_imgs\imagestrips

Particularly, entity_imgs_1.gif (18x546) does the magic. I simply couldn’t realise how one static image could be used in CRM for different configurations of navigation. You will be amazed to see how smart CRM is using this one static strip for different arrangements of navigation panel. In order to make it sure, I did a little mark in the account icon in it and checked the outcome.

It changes the navigation pane.

I don’t know whether this gives a total solution, but this will help someone who wishes to try changing the icons of default entities. Anyway, I would say something for sure; creating icons for CRM is not a job of someone who knows “something” about imaging. It should be a job of professional, because you won’t be able to create a meaning full icon in just 16x16 pixels within a transparent background, unless you are really skilful.

FYI : Good site to search for icons for Dynamics CRM