Search This Blog

Friday, June 5, 2009

Add an information message in CRM form


With the following script, you can add an information message to a CRM form


var newcontent = document.createElement("div");
newcontent.id = "message";

newcontent.style.border = "solid 1px black";
newcontent.style.marginLeft = "10px";
newcontent.style.marginRight =
"10px";
newcontent.style.marginTop = "0px";
newcontent.style.marginBottom = "4px";
newcontent.innerHTML =
"<table border="'0'" cellspacing="'0'"
cellpadding="'4'"><tr><td
style='width:20px;background-color:#FFFFAE'><img
src="'/ico/16_info.gif'/" /></td><td
style='font-family:Tahoma;font-size:11px;padding-left:8px;background-color:#FFFFAE;width:100%'>This
is an information
message.</td></tr></table>";

var scr = document.getElementById(elementId);
scr.insertBefore(newcontent, scr.firstChild);



Juste replace elementId with:
"areaForm" to place the message on top of tabs
"tabX" to place the message in the tab X (X is the index of the tab)


[UPDATE]
Si had put a easier and more integrated solution in the comments. So I put his solution right here to avoid further navigation. Thank you, Si!
Nice, just used this but you can see from the screen shot that inserting
the div as the first child of areaFrom makes the bottom of the form disappear,
you can't see the bottom of the scoll bar is not visible.
I've checked the form dom and there's a nice div called Navigation that is
already styled with a yellow backgroundHere's your code altered slightly that
allows CRM to format the screen correctly, it can also be called multiple times
and will update the text.

var sText = 'Hello World!';
var elementId = 'Notifications';
var id = 'divMessage';
var src = document.getElementById(elementId);
var newcontent = document.createElement("span");
newcontent.id = id;
newcontent.innerHTML = "<table><tbody><tr><td><img src="/_imgs/ico/16_info.gif" /></td><td valign="'top'">" + sText +
"</td></tr></tbody></table>";
src.style.display = "";
var previous = src.firstChild;
if (previous == null previous.attributes['id'].nodeValue != id)
{
if (src.childNodes.length == 0)
src.appendChild(newcontent);
elsesrc.insertBefore(newcontent, src.firstChild);
}
else
src.replaceChild(newcontent, previous);

Thursday, June 4, 2009

New tool! Header Builder

Hi,

I developed a new tool, a small one this time.

It simply allows you to create a new header for Microsoft Dynamics CRM 4.0 application.

Some customers don't want to highlight the name and logo of the solution and prefer to put their own company logo instead.

With this tool, you can choose an image and merge it with the header background of Microsoft Dynamics CRM 4.0.

The programm manages transparency, size and position of the image on the header background.

You can then save the new header iamge and replace the original one located in CRMWeb\_imgs\masthead.jpg (don't foget that it is unsupported and you must backup the original file)

No screenshot for the moment

Download: