Images

,





Resize Form & Hide Left Navigation Area of CRM Form

,

Hi,

As much as I like the look and feel of CRM when you are developing a true xRM solution for a client, as we all know, less can be more.

With this in mind, whilst developing a solution for a client recently, I wanted to hide the entire left-hand navigation menu to give my form a simpler feel to it. So when setting it up I used 2 handy little pieces of JavaScript.

The first resized the window, OnLoad, to the size I wanted for my form:

window.resizeTo(700,520);

This gave me the following OnLoad:

78

As you can see though, most of the screen is taken up with the Left Navigation are, which for this form I didn't need.  So, i hid it using the following code:

document.all.crmNavBar.parentElement.style.display = "none";
document.all.tdAreas.colSpan = 2;

Which game me the following results….

77

As I said, nice simple JavaScript but I think it makes a huge difference to the appearance of the form and therefore (hopefully) how well the user interacts with it.

Enjoy!

Joel

Set CRM Form To Full Screen

,

Hi,

Quick but useful piece of JavaScript for you. Put this in the OnLoad event of any CRM form and it will maximise the window to fill your current screen size. Handy eh?!

window.moveTo(0,0);

window.resizeTo(screen.availWidth, screen.availHeight);

Enjoy!

Joel

test

,

Dynamics CRM 4.0 - Filtered Lookups From Picklist Value

,
Howdy, 


The below script is for doing filtered lookups based on a picklist value - nice piece of script!


document.FilterLookup = function(source, target)
{
    if (IsNull(source) || IsNull(target)) { return; }
    var name = IsNull(source.DataValue) ? '' : source.SelectedText;
name=encodeURIComponent(name);
    target.additionalparams = 'search=' + name;
}
document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);



Paste the following into the OnChange event of the Picklist:

document.FilterLookup(crmForm.all.yourpicklistfieldname, crmForm.all.yourlookupfieldname);


Dynamics CRM 4.0 - Restricted Bulk Edit of Attributes

,
Hi,


I was trying to bulk edit a number of attributes today on the contact form but for some reason, MS Dynamics CRM 4.0 would not let me. After some research I discovered that you cannot perform bulk edits of a field that has an active OnChange event.


To get around this, simply disable the event (un-tick the box), save and publish, make your changes and the re-enable the event


Handy!

Dynamics CRM 4.0 - Display field dependant on Picklist values

,
Hi,

In the below example, i had a list of 5 values stored in a field as a picklist. When values 1 and 2 were chosen i wanted to hide the field, and display it when values 3,4 and 5 are selected. If you only have a single value to hide the field, then simple remove the "if else" part of the code below...


if(crmForm.all.cit_phonestatus.DataValue == 1)
{
    crmForm.all.cit_dateret.disabled = true; // to disable

    // to hide
    crmForm.all.cit_dateret.style.display = "none";
    crmForm.all.cit_dateret_c.style.display = "none"; // for label
}
else if(crmForm.all.cit_phonestatus.DataValue == 2)
{
    crmForm.all.cit_dateret.disabled = true; // to disable

    // to hide
    crmForm.all.cit_dateret.style.display = "none";
    crmForm.all.cit_dateret_c.style.display = "none"; // for label
}

else {

crmForm.all.cit_dateret.disabled = false;
    crmForm.all.cit_dateret.style.display = "";
    crmForm.all.cit_dateret_c.style.display = "";
}