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();

Restricting access to IFRAME (read-only IFRAME)


This is a complementary post to my original post about creating a read-only iframe. The former post opens a new window outside of the users reach and steals the IFRAME focus. The following code makes use of the SECURITY=”restricted” IFRAME attribute that was introduced in IE6.
Since you can’t set this attribute from script once the IFRAME is on the form you need to remove the original IFRAME and create a new one instead.
The following code tells the tail.

One thing to notice is that the IFRAME will be completely inaccessible. This means that you can not script against the IFRAME at all. If you’re using my IFRAME viewer utility this solution won’t work for you.


function OnCrmPageLoad()
{
RestrictAccessToIFrame("IFRAME_Test");
}

function RestrictAccessToIFrame(iframeId)
{
/* Reference the relevant IFRAME */
var testIframe = document.all[iframeId];
/* get the iframe parent container */
var testIframeParent = testIframe.parentElement;

/* if the IFRAME exist */
if (testIframe)
{
/* Save the Original Iframe HTML */
var testIframeHTML = testIframe.outerHTML;
/* Remove the Original IFRAME */
testIframeParent.removeChild(testIframe);
/* Create a new IFRAME Instead */
testIframe = document.createElement(testIframeHTML);
/* Add an IFRAME restriction attribute to the new IFRAME Element */
testIframe.setAttribute("SECURITY","restricted");
/* IF needed rebuild the IFRAME url */
testIframe.src = "/MicrosoftCRM/_root/homepage.aspx?etc=1";
/* Append the IFRAME to its original parent element */
testIframeParent.appendChild(testIframe);
}
}

OnCrmPageLoad();

Tuesday, November 11, 2008

CRM 4.0 Field Level Security Wizard


My company uses the dynamics platform as basis for its products. From a product point of view, dynamics is an awesome foundation but is lacking many important functionalities which our soon to be customers require. In order to fill those gaps and achieve a fast pace product integration with as little development effort as possible we build functional wizards, in-house Utility Add-ons, to a variety of development tasks and business needs. Our goal eventually is to enable our integration team accomplish those tedious tasks in just a few clicks. A good example of that is the Field Level Security wizard which is presented herein.

As we already put time and effort in building those smart solutions, I thought it would be great to somehow share them with you on a “shareware” basis. In simple terms I decided to uncover those wizards with their full source code and installation instructions for a small and very affordable one time fee. Once you acquire the rights you can utilize and implement each wizard in any of your dynamics solutions as if it is your company own property.

The wizards will undoubtedly save you hundreds of development hours, speed up you delivery and much more. Since I’m testing this initiative for the time being I wanted to give you a taste and share this post with you. If you find this interesting, share your thought and questions with me (comment or send an email to support@gicrm.com).

The Field Level Security Wizard is a fully functional solution which enables you to define security settings throughout the organization hierarchy. In other words you can create FLS templates for each business unit, override or extend those settings for each security role and more importantly create exceptions at the user level. This gives you a much tighter security control over the entire dynamics application.

One of the most common tasks partners need to accomplish in every CRM project is hiding or showing specific form function (e.g. tab, toolbar button or left navigation link) depending on the user business unit, role and user. The FLS wizard can also facilitates this type of tasks with ease.

In the following demonstration I implemented a simple scenario on the account entity. First I create a simple FLS template on the business unit level by hiding the Main Phone and City fields, then I override those settings for the system administrator role by giving the role limited access to those fields and finally I create a specific exception for the administrator (me) and override/enable these fields completely.

In order to rewind the video right click on the flash movie, click rewind and then play.



FLS Features and information:
1. Supported Entities - All entity types (System, Customizable and Custom).
You can find the entire entity list inside CRM advanced find window.

2. Supports both online and offline modes.

3. Supports the following CRM modules:
  1. Entity Form (Can be extended using client side API)
  2. Entity Print Form
  3. Entity Views
  4. Entity Views Print page
  5. Static Export to Excel
  6. Advanced Find
  7. Mail Merge
  8. Merge
  9. Filtered View (For Reports)
  10. Entity Associated views
  11. Lookup views
  12. CRM Workflows

4. Supported Languages - FLS Customizations are available in all base languages – no language packs needed, But you’ll need to translate them your self.

5. Supported Layouts - Dir RTL ( Right to Left ) and LTR ( Left to Right ) layouts

6. Supports the following field level security modes:
  1.  Default – Field is not set
  2.  Hidden – Field is hidden on both crm form and views
    a.  Keep layout – the field space is kept
    b.  Collapse layout – the field space is collapsed for better presentation
  3.  Missing – Field is disabled , the user can not see the data
  4.  Disabled – Field is disabled , the user can see the data
  5.  Enabled – Override existing settings, the user has full permissions on the field.

7. Supports “Formless” Entities – Entities that do not have a form like activity

8. Supports Security Hierarchy:


  1. Business Unit level: Creation of FLS Templates that affect the entire business unit.
  2. Role Level: Inheritable security roles with an option to extend or override business unit settings
  3. User Level: Inheritable User settings with the option to create exceptions for users within the same role

9. Fields View - Intelligent Orientation.


The user can filter by:
  1. Field Type: Presents all available field types
  2. Existing: Presents existing Settings
  3. Placement: Presents fields that exist ON and OFF the CRM Form
  4. Tabs: Presents All Fields Categorized by Tab Name
  5. Sections: Presents All Fields Categorized by Section Name

The wizard also supports Internet Facing Deployment (IFD) and IE8

As you can see, we give a lot of attention to the entire usability issue. The idea is to enable the integrator / developer to achieve his FLS goals as fast as possible.

The wizard is now available online. I’m sure you’ll find it worthwhile. Feel free to comment here or send your questions to support@gicrm.com.