Monday, July 31, 2006

Hiding CRM navigation buttons

Within the current version of MS CRM, version 3.0, it is possible to hide
navigation buttons.

The javascript below gives an example for this. Put it in the Onload Event of the
entity you want to influence.

The Element ID's can be found via a simple trick:

Go to the form where you want to hide the buttons. Press Ctrl + N, this
will result that het current page will be re-openend in a new IE Window.

Within this Window you can view the page source code, via the menu options "View" "Source".

//..hide navigation

Hide( window.document.getElementById( "navProds" ) );
Hide( window.document.getElementById( "navRelationship" ) );
Hide( window.document.getElementById( "navOrders" ) );
Hide( window.document.getElementById( "navInvoices" ) );
Hide( window.document.getElementById( "navExistingProducts" ) );
Hide( window.document.getElementById( "navWriteInProducts" ) );

//..hide object function

function Hide( obj )
{
obj.style.visibility = "hidden";
obj.style.position = "absolute";
}

Generating T.a.v and Briefhoofd for the Dutch Microsoft CRM users

This javascript example can be used to create an "t.a.v" and "briefhoofd" for the
Dutch version of Microsoft CRM. Ofcourse this can also be modified to use in other
languages. I'm just lazy to put it in an other language...

It can be expanded with specific language settings if the CRM instance is used to save Contacts with from different countries.


var strAanhef;
var strBriefHoofd;
var strMiddleName;
var str1;
var str2;

if( crmForm.all.gendercode.DataValue == 1 )
{ strAanhef = "T.a.v. de heer" strBriefHoofd = "Geachte heer"};

if( crmForm.all.gendercode.DataValue == 2 )
{ strAanhef = "T.a.v. mevrouw" strBriefHoofd = "Geachte mevrouw"};

//..Aanhef functionscrmForm.salutation.value = strAanhef + IsNull

(crmForm.all.pager.DataValue) + IsNull(crmForm.all.nickname.DataValue) + IsNull(crmForm.all.middlename.DataValue) + IsNull(crmForm.all.lastname.DataValue) + IsNull(crmForm.all.suffix.DataValue);

//..BriefhoofdcrmForm.new_briefhoofd.value = strBriefHoofd + WordCapitalize

(crmForm.all.middlename.DataValue) + IsNull(crmForm.all.lastname.DataValue) + IsNull(crmForm.all.suffix.DataValue) ;

function IsNull( value )
{if("undefined" == typeof( value ) "unknown" == typeof( value ) null == value )
return "";
else
return " " + value;}

function WordCapitalize(word)
{if ( "undefined" == typeof( word ) "unknown" == typeof( word ) null == word ) return "";
else
return " " + word.charAt(0).toUpperCase() + word.substring(1, word.length);}