Wednesday, November 12, 2008

Creating Mini Form Sections


The mini sections are a great way to create smaller logical areas inside a CRM section.
If you take a look at the field level security wizard you’ll see that we have used the mini section to create headings for each and every step.

Creating the mini section is fairly simple. All you need to do is create a new text attribute for each section and hide its label from within the customization. The code gets the hidden label text, places it inside the attribute control (DataValue) and formats the layout.

The end result looks like this:




function OnCrmPageLoad()
{
/* Convert the text attribute ‘gi_ministep1’ to a mini section */
CreateMiniSection("gi_ministep1");
}

function CreateMiniSection( ctrlId )
{
var Control = crmForm.all[ ctrlId ];
if ( !Control ) return;
Control.DataValue = " " + crmForm.GetLabel(Control);
Control.Disabled = true;
Control.style.cssText = "font-weight:900;border:1px solid #94b2de;filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#eff3ff,EndColorStr=#cedfff)";
}

OnCrmPageLoad();

No comments: