





















































(For more resources related to this topic, see here.)
Forms are probably the most important visual element of the Dynamics CRM 2011 interface. To find the underlying data in every entity record, the user has to open the form. Dynamics CRM 2011 supports two types of forms:
One main form per entity exists by default. However, multiple main forms can be created for an entity. Dynamics CRM 2011 supports role-based forms, which means separate forms can be visible depending on the security roles of the current user. Usually, multiple main forms are created when role-based forms have to be supported.
If users try to access Dynamics CRM 2011 from an unsupported browser, they will be redirected to the mobile form.
The following table outlines the browsers supported by Microsoft Dynamics CRM 2011:
Browser
|
Version / other requirements
|
Internet Explorer
|
IE7 (only for the on-premises version)
IE 8, IE9
IE10 (desktop mode only)
|
Mozilla Firefox
|
Latest publicly released version running on Windows 8, Windows 7, Windows Vista, or Windows XP
|
Google Chrome
|
Latest publicly released version running on Windows 8, Windows 7, Windows Vista, or Windows XP
|
Apple Safari
|
Latest publicly released version running on Mac OS X 10.7 (Lion) or 10.8 (Mountain Lion)
|
Detailed information about supported browsers can be found at http://technet.microsoft.com/en-us/library/hh699710.aspx.
Dynamics CRM 2011 also supports special variants of the main form, as follows:
Update Rollup 12 has introduced the following changes in read-optimized forms:
Read-optimized forms honor all field-level security and role-based form definitions. If an entity has more than one form enabled, the read-optimized form uses the form that the user last used.
For the Account, Contact, Lead, Opportunity, and Case entities, in addition to the information form, there will be a new form with the same name as that of the entity. The <entity name> form will always display using the updated presentation, regardless of the settings for read-optimized forms. However, if read-optimized forms are enabled for the organization, the information form will also display using the updated presentation.
These new forms are not available in an on-premises deployment of Microsoft Dynamics CRM 2011.
We need to use a form editor to customize a form within Dynamics CRM 2011. The form layout definition is actually stored as an XML file called Form Xml in the SystemForm entity. The customization.xml file exported with an unmanaged solution contains the definition of the entity forms.
Almost all the business entities have a customizable main form. The Activity entity does not have any form and some entity forms such as the Case Resolution entity form are not customizable. When a custom entity is created, one main and one mobile form are added automatically. In this recipe, we will focus our discussion on how to customize a main form.
Dynamics CRM 2011 introduced a flexible layout for form design. The following diagram outlines the typical main form layout within the Dynamics CRM 2011 system:
The major visible components of a standard main form are as follows:
We will now take a look at the various form-body elements that can be added or associated with an entity form:
A tab can have one column or two columns; when two columns are specified, the width of each column is a percentage of the width of the tab. A section, on the other hand, may have up to four columns and we can control the width available for control labels to be displayed in the section as well as how labels for controls in the section should be aligned.
The first four subgrids can be populated with data in a form when it loads. If more than four subgrids exist on a form, the remaining subgrids require some user or form script action to retrieve data. This is for performance optimization.
In this recipe, we will first discuss how to create a new main form and then discuss the form-customization options. The customization steps can be carried out on any main form.
The entity main form can be customized by carrying out the following tasks:
In this recipe, we will discuss all the previously stated tasks one after the other. Please follow these steps to customize the main form for an entity:
The next step is to create a new main form; this can be done in two ways. We will discuss both of these here:
Any newly created main form will be assigned only to the system administrator and system customizer security roles by default.
To customize a main form, open the form by double-clicking on it in the forms list.
The next step is to discuss the editing of tabs in the form. Tabs are collapsible controls that can contain section controls. The following two points will demonstrate adding a new tab and editing tab properties:
If we add a tab, Dynamics CRM 2011 will automatically add a section for each column.
To remove any control in an entity form, use the Delete key on the keyboard. Alternatively, the Remove button in the ribbon can also be used.
Tab property
|
Description
|
Under the Display tab
|
|
Name
|
The unique name of the tab.
|
Label
|
The display label for this tab. This text will appear on the form.
|
Show the label of this tab on the Form
|
This determines whether the label defined for this tab will be displayed on the form. Select this option to enable the display of the tab's label on the form.
|
Expand this tab by default
|
If selected, the tab control will be displayed in expanded mode by default.
|
Visible by default
|
If selected, the tab control will be visible by default in the form.
|
Under the Formatting tab
|
|
Select tab layout
|
Choose between One Column and Two Columns to define the layout of the tab.
|
Column 1 width
|
If the Two Columns option is selected in the tab layout, we can specify the width of column 1 as a percentage.
|
Column 2 width
|
If the Two Columns option is selected in the tab layout, we can specify the width of column 2 as a percentage.
|
The Events properties
|
|
|
Scripts libraries can be linked to the tab. The scripts functions will be called on the TabStateChange event.
|
Next we will see the editing of a section in a tab. A section contains fields in the form. The following two sections will demonstrate adding a section in a form and editing the section's properties:
Section property
|
Description
|
Under the Display tab
|
|
Name
|
The unique name of the tab.
|
Label
|
The display label for this tab. This text will appear on the form.
|
Show the label of this section on the Form
|
This determines whether the label defined for this section will be displayed on the form. Select this option to enable the display of the section's label on the form.
|
Show a line at top of the section
|
If selected, a divider line will be displayed underneath the name of the section.
|
Width
|
Specify the width of the label area of the fields in this field. The width must be set between 50 and 250 pixels.
|
Visible by default
|
If selected, the section control will be visible by default on the form.
|
Lock the section of the Form
|
If selected, the section would be locked in the form.
|
Under the Formatting tab
|
|
Layout
|
Choose from among One Column, Two Columns, Three Columns, and Four Columns to define the layout of the section control.
|
Field label alignment
|
Select between the Left and Right alignments for the field labels in the section control.
|
Next we will take a look at editing a field in the section:
After selecting the field in Field Explorer , move the field by pressing the left mouse button and drop the field in the intended column of the section. The red line on top of the column indicates that the column has been selected. Now drop the field on the selected column.
Field property
|
Description
|
Under the Display tab
|
|
Label
|
Here you can edit the display name of the field on the form. By default, the display name of the field will be displayed there, which can be edited to provide a new display name for the field on the form.
|
Display Label on the form
|
This determines whether the display name of the field is to be displayed in the form.
|
Field is read-only
|
This determines whether a field is to be read-only for the users in the form.
|
Lock the field on the form
|
This determines whether the field is to be locked on the form.
|
Visible by default
|
This determines the default visibility of the control in the form.
|
Under the Formatting tab
|
|
Layout
|
This determines the width of this field on the form. The width of a field depends on the layout settings of the section it is in.
|
The Details properties
|
|
|
This tab displays the details of the field definition. Click on the Edit button to modify those properties of the field definition that can be modified.
|
The Event properties
|
|
|
Script libraries can be linked to the tab. The scripts' functions will be called on the OnChange event.
|
If the field is of type Lookup (N:1 relationship with another entity), then there exists an additional set of properties in the Field Properties list. These properties can be set to save the user's time, find the appropriate parent record, or to restrict the user to select among a subset of records in the parent entity. The following form-level properties of the lookup field can be edited:
Property name
|
Description
|
Turn off automatic resolutions in the field
|
If this setting is disabled (not selected) and if a user enters a partial value for the lookup field and tabs away, Dynamics CRM 2011 will try to autopopulate the lookup field.
|
Disable most recently used items for this field
|
If this setting is disabled (not selected), Dynamics CRM 2011 will automatically provide a list of recently selected values for the user to choose from.
This property is not supported for process-driven forms of Microsoft Dynamics CRM 2011 Online.
|
Related Record Filtering
|
This setting provides a way to limit the list of records that the user can choose from. The list under the Only show records where heading displays all the potential relationships that can be used to filter this lookup. Once a record is selected, the list under the Contains heading will display all relationships that connect the related entity (selected in the first list) to the target entity.
Select the Allow users to turn off filter checkbox to provide users with the option to turn off the filter defined here. This makes it possible for them to view a wider range of records.
|
Additional properties
|
This setting controls how much search flexibility the user will have in terms of changing among various views and searching the record with a search box.
Select the Display Search Box in lookup dialog checkbox if you want a search box to be available in the lookup.
In the Default View list, select the default view for which results will be displayed in the lookup.
Finally, choose the views we want users to have access to in the lookup, using the View Selector list.
|
Next we will delve into editing headers and footers.
To edit the header or footer of the form, click on the Header or Footer button in the form ribbon and the section will be focused automatically. Then click on Change Properties in the ribbon. The Header Properties or Footer Properties page will pop up and we can edit the following settings:
Header/footer property
|
Description
|
Under the Display tab
|
|
Width
|
Specify the width field label area here. The width must be set between 50 and 250 pixels.
|
Lock the section of the Form
|
This setting is selected by default and cannot be modified. This setting determines whether the section would be locked in the form or not.
|
Under the Formatting tab
|
|
Layout
|
Here you can choose from among One Column, Two Columns, Three Columns, and Four Columns to define the layout of the header/footer control.
|
Field Label Alignment
|
Select from the Left (default), Right, or Center alignment for the field labels in the header/footer control.
|
Field Label Position
|
Select between Side (default) and Top to specify whether the field label in this section will be on the left-hand side or above the field.
|
Fields can be added to the header or footer controls in the same way they are added in any section control in the form.
Next we will look at how to add subgrids. The Sub-Grid control displays related entity records in the form body, using the following steps:
Subgrid property
|
Description
|
Under the Display tab
|
|
Name
|
The unique name of the subgrid control.
|
Label
|
The display text of the subgrid. This text will be displayed on the form.
|
Display label on the Form
|
Select to confirm that the Label text will be displayed on the form.
|
Data Source
|
This specifies the primary data source of the subgrid.
The Records list allows us to select between Only Related Records (to set only entities having a relationship to the current entity) and All Record Types (to set all available entities).
We can choose the related entity from the Entity list. This list content will vary based on the earlier list's selection.
The Default View list allows us to choose which view is to be displayed in the subgrid.
|
Display Search Box
|
Select this setting to display the search box in the subgrid.
|
Display Index
|
Select this setting to display the alphabetic index record selector in the subgrid.
This property is not supported for process-driven forms of Microsoft Dynamics CRM 2011 Online.
|
View Selector
|
Select this setting to display the view selector in the subgrid.
This property is not supported for process-driven forms of Microsoft Dynamics CRM 2011 Online.
|
Chart Options
|
Select whether to display a chart selector along with a default chart or show only a specified chart in place of the subgrid.
This property is not supported for process-driven forms of Microsoft Dynamics CRM 2011 Online.
|
Under the Formatting tab
|
|
Layout
|
Choose from among One Column, Two Columns, Three Columns, and Four Columns to define the layout of the subgrid control.
|
Number of Rows
|
Select the maximum number of rows to be displayed in the subgrid control. The number of rows has to be between 2 and 250.
|
Automatically expand to use available space
|
Select this setting to enable automatic expansion of the subgrid to use available space in the form.
|
iFrames or Inline Frames are HTML documents embedded inside the Dynamics CRM entity form. The following steps will guide you through adding an iFrame in the form:
iFrame property
|
Description
|
Under the General tab
|
|
Name
|
The unique name of the iFrame control.
|
URL
|
The URL of the HTML document to be displayed in the iFrame control.
|
Pass record object-type code and unique identifier as parameters
|
Select this option to pass contextual information entity object-type code and the record's unique identifier to the iFrame.
Read more about this in the How it works... section of this recipe.
|
Label
|
Here, specify the display text for the iFrame.
|
Display label on the Form
|
Select this setting to display the label on the form.
|
Restrict cross-frame scripting, where supported
|
This checkbox is selected by default. We can remove this restriction only if we are certain that the HTML document/site we are using as the target of the iFrame can be trusted.
|
Visible by default
|
Select this setting to make the iFrame visible by default on the form.
|
Under the Formatting tab
|
|
Layout
|
Choose from among One Column, Two Columns, Three Columns, and Four Columns to define the layout of the iFrame control.
|
Number of Rows
|
Select the maximum number of rows the iFrame control occupies on the form. The number of rows has to be between 1 and 40.
|
Automatically expand to use available space
|
Select this setting to enable automatic expansion of the iFrame control to use the available space in the form.
|
Scrolling
|
Select the scrolling option for the iFrame content display.
|
Display Border
|
Specify whether a border for the iFrame control is to be displayed.
|
Web resources represent files that can be used to extend the Microsoft Dynamics CRM 2011 web application, such as HTML files, Image files, JScript library, and Silverlight applications. The following steps can be used to add a web resource in the form:
Select the section control where the web resource is to be added in the form.
Then click on the Web Resource button under the Insert tab in the form ribbon. This will bring up the Add Web Resource page, where we can specify the following properties of a web resource:
Web resource property
|
Description
|
Under the General tab
|
|
Web Resource
|
Lookup to find a form-enabled web resource.
|
Name
|
The unique name for the web resource.
|
Label
|
Specify the display text for the web resource here.
|
Display label on the Form
|
Select this setting to display the label on the form.
|
Visibility by default
|
Select this setting to make the web resource visible by default on the form.
|
Show this web resource in Read-Optimized Form
|
Select this setting if the web resource is to be displayed in the read-optimized form.
|
Under the Formatting tab
|
|
Layout
|
Choose from among One Column, Two Columns, Three Columns, and Four Columns to define the layout of the web resource control.
|
Number of Rows
|
Select the maximum number of rows the web resource control occupies on the form. The number of rows has to be between 1 and 40.
|
Automatically expand to use available space
|
Select this setting to enable automatic expansion of the web resource control to use the available space in the form.
|
Scrolling
|
Select the scrolling option for the web resource content display.
|
Display Border
|
Specify here whether a border for the web resource control is to be displayed.
|
The Dependencies properties
|
|
|
Select the fields from the Available fields list that are required by the web resource, and then click on the
|
The navigation area displays entities that are related to the current entity. Each relationship has a Label property and in this navigation section this Label property is displayed by default. However, the display name for the related entity can be changed. This display name does not update the Label property of the relationship. In order to edit the navigation area, perform the following steps:
Next we will edit the form properties; in order to do this, click on the Form Properties button in the form ribbon and the Form Properties page will pop up. The following properties can be edited there:
Form property
|
Description
|
The Event properties
|
|
|
Add or remove the JScript libraries that will be available for the form or field events.
|
Under the Display tab
|
|
Form Name
|
The display name for the form. Modify this to rename the form.
|
Description
|
Specify a description for this form here.
|
Show navigation items
|
Select this setting to display the page navigation in the form.
|
The Parameters properties
|
|
|
Add query string parameters to be passed to the form. Click on the green plus sign to add a query string. We have to provide a Name value and select a Type value of the query string parameter.
|
The Non- Event Dependencies properties
|
|
|
Select the fields from the Available fields list that are required by any external, non-event scripts, and then click on the
|
Lastly, making a form non-customizable restricts any future customization of the form. Therefore, to make a form non-customizable, perform the following steps:
After making any changes to an entity form, the form has to be saved and published. Use the Publish button in the form ribbon to publish the changes.
Web resources and iFrames are not displayed using the Microsoft Dynamics CRM 2011 for Outlook reading pane, but iFrames are displayed in read-optimized forms. When the Pass record object-type code and unique identifier as parameters setting is enabled, iFrames allow the form to pass the following contextual parameters to itself:
Parameter name
|
Description
|
typename
|
The name of the entity.
|
type
|
This takes in the entity type code, which is an integer value to uniquely identify an entity in a specific organization.
|
Id
|
A GUID that represents a record.
|
orgname
|
The organization's name.
|
userlcid
|
The user's language code.
|
orglcid
|
The organization's language code.
|
The list of entity type codes can be found at http://msdn.microsoft.com/en-us/library/gg328086.aspx. The key points about entity type codes are as follows: