Configure fields
Common configuration tasks for all field types
All fields in Microsoft Dynamics CRM share some common configuration tasks and each type of field has specific capabilities. You can perform the following tasks on all fields.
Note
Configuring fields requires privileges that allow you to customize entities. Typically the System Administrator or System Customizer security roles are required.
Add fields to a form
Fields in forms represent a corresponding entity attribute. For information about entity attributes, see Create or Edit Entity Attributes.
After an entity attribute has been configured, you can add to the form as a field.
- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click the entity to open it.
- In the Details area, click Forms and Views.
- In the Forms and Views list, double-click Form to open the form editor.
- In the Common Tasks area, click Add Fields.
- Select the fields you want to add to the form.
- In the Location area, in the Tab and Section lists, select the tab and section in which you want to place the selected field or fields, and then click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Change the label or display name for a field
There are two separate places where the name for a field is defined. You might want to use different names depending on where the field is displayed. For example, in the entity form, you might want a longer, more descriptive label or you might not want to display a label at all. When the field is displayed in a view, you might want a shorter display name because it is used in column headings.
Change the label for the field in a form
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- In the Field Properties dialog box, change the value of the Label field.
- Clear the Display label on the form check box if you do not want to display the label on the form.
- Click OK to close the Field Properties dialog box.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Change the Display Name for the field displayed in views
Navigate to the attribute that represents the field.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Attributes.
- Double-click the attribute that you want.
- In the Schema column, set the value of the Display Name field.
- Click Save and Close to close the Attribute form.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Make a field required or recommended
A required field must contain data or the record is not saved. A red asterisk appears near the field to indicate that the field is required. A recommended field has a blue "+" indicating that the information is important but not required to save the record.
Navigate to the attribute that represents the field.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Attributes.
- Double-click the attribute that you want.
- In the Schema column, set the value of the Requirement Level field:
- No Constraint: The field that represents the attribute does not require data to save a record.
- Business Recommended: A requirement level used for fields that should contain a value. You can save the record when this field does not contain a value. Recommended fields are marked with a blue "+" symbol.
- Business Required: A requirement level used for fields that require a value in before saving the record. Required fields are marked with a red asterisk.
- Click Save and Close to close the Attribute form.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Control whether a field can be used in Advanced Find
Any entity might contain a large number of attributes that contain data. Not all attributes that contain data are included in the entity form. For example, the Created By and Created On attributes are often not included in the form, but you might want to search using these as criteria. By default, most attributes are searchable. You can have a shorter list of fields in Advanced Find if you make the fields not searchable.
You can control which fields are available as search criteria in Advanced Find to create a shorter list of just the most relevant fields. This setting also determines which fields are available as criteria when customizing find columns in the Quick Find View and the Lookup view.
Navigate to the attribute that represents the field.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Attributes.
- Double-click the attribute that you want.
- In the Schema column, set the value of the Searchable field to "No" if you do not want the field to be used in Advanced Find.
- Click Save and Close to close the Attribute form.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Disable a field in a form
You might want to disable a field on the form to make it read-only. Use a field that is read-only, for example, when client-side script is used to calculate the value of the field or to enable the field only for specific users.
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- In the Field Properties dialog box, select Field is read-only and click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Prevent a field from being removed from a form
Some business processes or automation may depend on certain fields being present in a form. If a field is removed from a form, the business process or automation will break. There are two ways to prevent removal of a field from a form:
- Lock the field on the form.
- Set the field as a dependency for a script.
Lock a field in the form
Locking a field prevents anyone from removing a field from a form. This also disables removing the tab and section that contain this field.
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- In the Field Properties dialog box, on the Display tab, select Lock the field on the form and click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Set a dependency on the field for a script
Setting a dependency on a field prevents anyone from removing a field from a form. This also prevents the tab and section that contain this field from being removed.
Scripts are initiated by events on the form or field, or by external scripts executed from a custom button or menu item in the form.
Set a non-event dependency on the form
Navigate to the Form Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form.
- In the Common Tasks area, click Form Properties
- On the Non-Event Dependancies tab, move fields from the Available fields area to the Dependent fields area and click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Set a dependency on the form events
Navigate to the Form Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form.
- In the Common Tasks area, click Form Properties
- On the Events tab, select the event that corresponds to the dependent script from the Event List and click Edit.
- On the Dependencies tab, move fields from the Available fields area to the Dependent fields area and click OK.
- Click OK to close the Field Properties dialog box.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Set a dependency on the field OnChange event
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- On the Events tab, select the onChange event from the Event List and click Edit.
- On the Dependencies tab, move fields from the Available fields area to the Dependent fields area and click OK.
- Click OK to close the Field Properties dialog box.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Remove a field from a form
Removing a field from the form doesn't remove the attribute that represents the field. You can add the field back to the form at any time.
Note
Some business processes or automation might depend on certain fields being present in a form. If a field is removed from a form the business process or automation might break. For more information, see the earlier section, Prevent a field from being removed from a form.
Navigate to the form editor.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form.
- In the form, select the field you want to remove.
- In the Common Tasks area, click Remove.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Move a field within a form
Forms are organized using tabs and sections. Sections go within tabs and fields go within sections.
Move a field to a different section
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- In the Field Properties dialog box, on the Display tab, in the Location area, select the Tab and Section you want to move the field to and then click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Move a field within a section
Navigate to the form editor.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form.
- In the form, select the field you want to move.
- In the Common Tasks area, click an arrow to move the selected item left, right, up, or down on the form.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Change the width of a field
The width of a field depends on the layout settings of the section it is in.
There are two possible formatting options for sections:
- Variable Field Width : Fields are set up in two columns. IFrames, nvarchar/textarea and ntext fields expand to the width of the form, and you can set the number of rows displayed. For other fields, you can specify whether the field is one or two columns wide.
- Fixed Field Width : You can choose the column layout: either two, three, or four columns with five possible layouts. Each field cannot exceed the column width of the column used for display. IFrames, nvarchar or text area and ntext fields are displayed within one column and you can set the number of rows displayed, but cannot set them to display across columns.
If the field is in a section that uses the Variable Field Width format and it is not an ntext field or an nvarchar field with the textarea format, you can adjust the width of the field using the following method. Otherwise, you need to create a new section using Fixed Field Width formatting and control the width of the columns with the section. For more information, see Edit Entity Forms, and click Edit the main form for an entity.
Change the width of a field in a variable field width section
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- In the Field Properties dialog box, on the Formatting tab, in the Layout area, select either One column or Two columns and click OK.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Add or edit a script to run when data in a field changes
Fields support the OnChange event. Forms support adding scripts to both the OnSave event and the OnLoad event.
Note
The OnChange event code is executed only when the data in the field changes and the field loses focus. The field loses focus when you click another field or press Tab to move to the next field.
Navigate to the Field Properties.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Forms and Views.
- In the list of forms and views, double-click Form to open the form editor.
- In the form editor, double-click the field that you want.
- On the Events tab, select the onChange event from the Event List and click Edit.
- On the Details tab, select Event is enabled and paste or type your JScript code into the function onChange() area and click OK.
- Click OK to close the Field Properties dialog box.
Test your script.- On the Preview menu, click Create Form, Update Form, or Read-Only Form.
- Enter the data in the field and verify that the event executes as expected when you click another field or press the tab key.
- To close the Preview form, on the File menu, click Close.
- Click Save and Close to close the form editor.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Set the Input Method Editor mode for a field
An Input Method Editor (IME) lets you enter and edit Chinese, Japanese, and Korean characters. IMEs have two principle states, inactive and active. The inactive mode behaves like a regular keyboard and uses a limited set of characters. The active mode accepts Chinese, Japanese, or Korean characters.
Navigate to the attribute that represents the field.- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- Double-click an entity to open it.
- Under Details, click Attributes.
- Double-click the attribute that you want.
- In the Type column, set the value of the IME Mode field:
- auto : The IME mode is not affected with this choice.
- active : All characters are entered in the IME mode, but you can still deactivate it. For name-related fields and addresses, the default is active.
- inactive :All characters are entered without using the IME mode, but you can still activate it. For datetime type fields, the default is inactive.
- disabled :The IME mode is disabled, and you cannot activate it. For number type fields such as money, int, and float, the default is inactive.
- Click Save and Close to close the Attribute form.
When you finish editing the entity, publish it.- On the Actions menu, click Publish.
- Click Save and Close to close the entity.
Related Links
11 things to know about customization
Form and view customizations
Entity customizations