söndag 23 januari 2011

Breathing some life in the CRM Service Calendar

Scenario 1:                      The Problem

For the current project which is a kind of booking system, the CRM Service calendar functionality will be quite central. Of course we want not just the functionality, the system should also have a nice look in order for the users to feel more comfortable using the system in the end.
The CRM Calendar Out of the Box does leave a whole lot to wish for… It is pale and quite uninteresting, just look at the screenshot below.


Scenario 1:                      The Investigation
Got lucky on Google and found some relevant information to start my experimenting:
Within the website directory for CRM (e.g. c:\inetpub\wwwroot), locate the \SM\Gantt\Style directory. Within that directory, locate the file GanttControl.css. Towards the bottom of the file, you will find an entry for each Status Reason that is added to the Service Activity entity. They will look something like this:

div.ganttBlockServiceActivityStatus8
{
border: 1px solid #A5DE63;
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#E7F6D6,endColorStr=#A5DE63);
}

As Status Reasons are added, an additional section like the one above is added to the file, with the # at the end of the first line corresponding to the integer value of the status reason. All you need to do to change the color is find the corresponding HEX code of the color you want to use and replace the startColorStr and endColorStr values in the corresponding block of code. Note, leave the # and replace the six characters after. A good location to find the corresponding HEX codes is here:
http://html-color-codes.com/ . This is what you'll find:

Simply use the corresponding code for the color you'd like. The result is a much more visually appealing Service Calendar:





Scenario 1:                      The Solution

I tried a couple of things: You can either have the fields single color (the line above the marked one)
Or if you wish to add some 3D effects, you can use the marked gradient effect on any of the settings.


I will now exaggerate a bit just to show that your imagination is the limit:

Good luck with the colouring of your calendar :O)


P.S. One thing that is not mentioned anywhere on the web is the fact that no matter how many changes you make in the GanttControl.css file NOTHING will happen (and you may give up cursing CRM again) until you close the browser and delete the Temporary Files in the browser since windows and IE are so helpful with caching things for us….

Alexander Berggren
CRM Rookie Of The Year


lördag 22 januari 2011

CRM - Multiple Notes Tab in IFrame

Scenario 1:                      The Problem

We are developing a Booking System for the client, at one point during the requirements gathering we discovered that we will need either another Notes tab on one of the entities alternatively some way of associating multiple notes with a particular entity / event.

Scenario 1:                      The Investigation

Went happily out on the web to google away…
The findings were however very meagre, found the following:
“I am trying to reference the notes from a related entity (e.g car entity notes) within an entity (e.g. case entity with a tab for car notes). What i did was opened up the entity (car entity) which contains the note (annotation) and got the src by hovering over the 'Click here to enter new note' (and also through the debugging tools).
The src is: /_controls/notes/notesdata.aspx?id={'GUID NUMBER HERE'}&ParentEntity=10045&EnableInlineEdit=true&EnableInsert=true
When i then put the full src url into the case entity car notes tab, the notes display there. I can edit the notes but cant create a new note. I get an error message "The requested record was not found or you do not have sufficient permissions to view it."
When I put it the actual record entity url into the src e.g userdefined/edit.aspx?id={'GUID NUMBER HERE'}&etc=10045&oType=2&security=852023" it shows the whole record form and I can create new notes etc but it looks messy as the Menus e.g. Save & Close etc and the details section are all visible within the iframe...NOT COOL AT ALL!
I think the issue with the first src url is that im referencing the notes from another entity within a different entity. Anyone have any ideas on how or what other parameters I can pass or something?
P.S I made sure that the entity ID im passing is correct, its showing the correct notes - just cant save it!”
Well, I, being a novice on CRM was happy because this at least got me on the right track as to where to begin in the first place. I went ahead coding happily.

And here is what happened:

Created a custom entity to be a container for the additional Notes:


Added the required 1:N relation between the new CustomerNote entity and the entity where the new Notes Tab and the Iframe will be added:



Modifying the entity where I am adding a new Tab with an Iframe: i.e. adding the new Tab, new section and the new Iframe to hold the Notes entity:











This is where the fun begins, according to the article found on the web (and others similar to it) we now need to enter the URL to the new custom entity and to the page that will handle the notes. The url should be:

/_controls/notes/notesdata.aspx?id={61DD79D5-C825-E011-81C9-8BF184968426}&ParentEntity=10029&EnableInlineEdit=true&EnableInsert=true&security=852023

Where the GUID is the ID of the new custom entity derived by simply looking into the CRM database in the table [YOUR_CRM_INSTANCE].[MetadataSchema].[Entity] like this:





And the ParentEntity Type is found in the same table on the entity that holds the Tab and Iframe:





And the resulting URL string will then be something like this:








So far so good, all set to Save and Publish and here we go:



Oooops…..



Now a whole lot of googling and investigating takes place, finally when you have almost given up, you speak to some co workers and everyone seems to agree that this has to be an issue with permissions, so you spend hours trying to sort out the permissions for the entities and to understand how on earth you can have this issues when you are actually running all this stuff as an System Administrator. Finally you give up and solve the whole problem in some other way, swearing a bit more each day and cursing the lack of help on the web when it comes to CRM and re-thinking your choice of profession.

Scenario 1: The Actual Error

The person reading this with some eye for the tiniest detail will say, HEY, Wait a minute, what is this I see in the corner???
Remember when we started this little adventure we were here:








And NOW when we get our frustrating ERROR we are here:


Wait a moment…. What is going on here?
AHA! We do have actually 3 CRM ORGANIZATIONS on the server…. Kollo, SSM and SIIW but there is only one installation of CRM and only one instance of /_controls/notes/notesdata.aspx if we care to have a look in the CRM Deployment Manager we will find that the SIIW instance is set as the DEFAULT instance and following that path CRM is trying to add our notes records into that SIIW instance and since there is no entity called CustomerNotes there….. CRASH#¤%¤

Scenario 1: The Solution
The solution to this particular problem is as simple as it is brilliant:
Just put the fully qualified URL in the Iframe URL field like this:

&EnableInsert=true&security=852023

Alexander Berggren
CRM Rookie Of The Year