JavaScript references in Microsoft Dynamics CRM 2013

The JavaScript object model is the JavaScript API that CRM provides to enable you to customize various behaviors based on events and to access CRM data that is present on a form.

CRM 2013 fully supports the JavaScript object model from the previous version; however, it does not support the JavaScript object model from Microsoft Dynamics CRM 4.0.

Check out following reference documentation for client-side events and object models that can be used with JavaScript libraries. * marked is new in CRM 2013.

Xrm.Utility: Xrm.Utility object provides a container for useful functions not directly related to the current page. The following table lists the functions of Xrm.Utility.

Xrm.Utility
alertDialog Displays   a dialog box with a message.
confirmDialog Displays   a confirmation dialog box that contains a message as well as OK and Cancel   buttons.
isActivityType Determine   if an entity is an activity entity.
openEntityForm Opens   an entity form.
openWebResource Opens   an HTML web resource.

Xrm.Page.data: Xrm.Page.data provides an entity object that provides collections and methods to manage data within the entity form. The following tables lists the functions of Xrm.Page.data and Xrm.Page.data.entity

Xrm.Page.data
getIsValid* Do a validation check for the data in   the form.
refresh* Asynchronously refresh all the data of the form without reloading the page.
save* Saves the record asynchronously with the option to set callback functions.
Xrm.Page.data.entity
addOnSave Adds a function to be called when the record is saved.
getDataXml Returns a string representing the xml that will be sent to the server when the record is saved.
getEntityName Returns a string representing the  logical name of the entity for the record.
getId Returns a string representing the GUID   id value for the record.
getIsDirty Returns a Boolean value that indicates if any fields in the form have been modified.
getPrimaryAttributeValue* Gets a string for the value of the primary attribute of the entity.
removeOnSave Removes a function to be called when the record is saved.
save Saves the record with the options to close or new.

Xrm.Page.context: Xrm.Page.context provides methods to retrieve information specific to an organization, a user, or parameters that were passed to the form in a query string. The following table lists the functions of Xrm.Page.context.

 Xrm.Page.context
client.getClient* Returns a value to indicate which client the script is executing in.
client.getClientState* Returns a value to indicate the state of the client.
getClientUrl Returns the base URL that was used to access the application.
getCurrentTheme Returns a string representing the current Microsoft Office Outlook theme chosen by the user.
getOrgLcid Returns the LCID value that represents   the base language for the organization.
getOrgUniqueName Returns the unique text value of the   organization’s name.
getQueryStringParameters Returns a dictionary object of key   value pairs that represent the query string arguments that were passed to the   page.
getUserId Returns the GUID of the SystemUser.Id value for the current user.
getUserLcid Returns the LCID value that represents the provisioned language that the user selected as their preferred language.
getUserName* Returns the name of the current user.
getUserRoles Returns an array of strings that represent the GUID values of each of the security roles that the user is  associated with.
isOutlookClient (Deprecated) Returns a Boolean value indicating if the user is using Microsoft Dynamics CRM for Outlook.
isOutlookOnline (Deprecated) Returns a Boolean value that indicates whether   the user is connected to the CRM server.
prependOrgName Prepends the organization name to the   specified path.

Xrm.Page.ui:  Xrm.Page.ui provides collections and methods to manage the user interface of the form. The following table lists the functions of Xrm.Page.ui

Xrm.Page.ui
clearFormNotification* Remove form level notifications.
close Method to close the form.
formSelector.getCurrentItem Method to return a reference to the   form currently being shown.
formSelector.items A collection of all the form items accessible to the current user.
getViewPortHeight Method to get the height of the viewport in pixels.
getViewPortWidth Method to get the width of the viewport   in pixels.
getCurrentControl Get the control object that currently has focus.
getFormType Get the form context for the record.
navigation.items A collection of all the navigation items on the page.
setFormNotification* Display form level notifications.
refreshRibbon Re-evaluate the ribbon data that controls what is displayed in it.
 Collections
Xrm.Page.data.entity.attributes All attributes on the page.
Xrm.Page.ui.controls All controls on the page.
Xrm.Page.ui.formSelector.items All the forms available to the user.
Xrm.Page.ui.navigation.items All the items in the form navigation   area.
Xrm.Page.ui.tabs All the tabs on the page.
Xrm.Page Attribute.controls All the controls for the attribute.
Xrm.Page.ui Section.controls All the controls in the section.
Xrm.Page.ui Tab.sections All the sections in the tab.
 Collections Methods
forEach Apply an action in a delegate function to each object in the collection.
get Get one or more object from the collection depending on the arguments passed.
getLength Get the number of items in the collection.

Attributes: Attributes store the data available in the record. Attributes are available from the Xrm.Page.data.entity.attributes collection. To access an attribute you can use the Xrm.Page.data.entity.attributes.get method or the shortcut version Xrm.Page.getAttribute. Following table shows how you can query attribute properties to understand what kind of attribute it is or change the behavior of the attribute.

 Xrm.Page.getAttribute(“…”)
getAttributeType Get the type of attribute.
getFormat Get the attribute format.
getIsDirty Determine whether the value of an   attribute has changed since it was last saved.
getIsPartyList Determine whether a lookup attribute   represents a partylist lookup.
getMaxLength Get the maximum length of string which   an attribute that stores string data can have.
getName Get the name of the attribute.
getParent Get a reference to the Xrm.Page.data.entity object that is the parent to all attributes.
getRequiredLevel Returns a string value indicating   whether a value for the attribute is required or recommended.
getSubmitMode Sets whether data from the attribute   will be submitted when the record is saved. always / never / dirty
getUserPrivilege Determine what privileges a user has   for fields using Field Level Security.
getValue / setValue Gets or Sets the data value for an   attribute.
setRequiredLevel Sets whether data is required or   recommended for the attribute before the record can be saved. none / required  / recommended
setSubmitMode Returns a string indicating when data   from the attribute will be submitted when the record is saved.
Number Attribute Methods
getMax / getMin Returns a number indicating the maximum   or minimum allowed value for an attribute.
getPrecision Returns the number of digits allowed to   the right of the decimal point.
setPrecision* Override the precision set for a number attribute.
DateTime Attribute Methods
setIsAllDay* Specify whether a date control should  set a value including the entire day.
setShowTime* Specify whether a date control should  show the time portion of the date.

Controls: Controls represent the user interface elements in the form. Each attribute in the form will have at least one control associated with it. Not every control is associated with an attribute. IFRAME, web resource, and subgrids are controls that do not have attributes. Controls are available from the Xrm.Page.ui.controls collection. To access a control you can use the Xrm.Page.ui.controls.get method or the shortcut version Xrm.Page.getControl. The following table lists the functions of Controls.

Xrm.Page.getControl(“…”)  
clearNotification* Remove a message already displayed for   a control.
getAttribute Get the attribute that the control is   bound to.
getControlType Get information about the type of   control.
getDisabled / setDisabled Get or Set whether the control is   disabled.
getLabel / setLabel Get or Set the label for the control.
getName Get the name of the control.
getParent Get the section object that the control   is in.
getVisible / setVisible Get or Set a value that indicates   whether the control is currently visible.
setFocus Sets the focus on the control.
setNotification* Display a message near the control to   indicate that data is not valid.

 Lookup Controls: The following table lists the functions of Lookup Control.

addCustomFilter* Use fetchXml to add additional filters   to the results displayed in the lookup. Each filter will be combined with an   ‘AND’ condition.
addCustomView Adds a new view for the lookup dialog   box.
addPreSearch* Use this method to apply changes to   lookups based on values current just as the user is about to view results for   the lookup.
getDefaultView / setDefaultView Get or Set Id value of the default   lookup dialog view.
removePreSearch* Use this method to remove event handler

OptionSet: The following table lists the functions of OptionSet Control.

getInitialValue Returns a value that represents the   value set for an optionset or boolean when the form opened.
getOption[s] Returns an option object with the value   matching the argument passed to the method.
getSelectedOption Returns the option object that is selected.
getText Returns a string value of the text for   the currently selected option for an optionset attribute.
adoption / removeOption Adds or remove an option to an option   set control.
clearOptions Clears all options from an Option Set   control.

IFRAME and Web Resource Controls:  An IFRAME control allows you to include a page within a form by providing a URL. An HTML web resource added to a form is presented using an IFRAME element. Silverlight and image web resources are embedded directly within the page. The following table lists the functions of IFrame or Web Resource controls.

getData / setData Get or Set the value of the data query   string parameter passed to a Silverlight web resource.
getInitialUrl Returns the default URL that an I-frame   control is configured to display. This method is not available for web   resources.
getObject Returns the object in the form that   represents an I-frame or web resource.
getSrc / setSrc Get or Set the current URL being   displayed in an IFrame or web resource.

Sub-Grid Control: Sub-Grid control has refresh method. We can use this method to refresh data displayed in a Sub-Grid.

refresh Refreshes the data displayed in a Sub-Grid.

OnChange Event: There are three methods you can use to work with the OnChange event for an attribute.

addOnChange / removeOnChange Sets or remove a function to be called   when the attribute value is changed.
fireOnChange Causes the OnChange event

Dialogs in Dynamics CRM 2013

Dialogs are a type of process in Microsoft Dynamics CRM that displays the input forms and the data that a user needs at each step while interacting with a customer or following a complex procedure. A dialog can have branching logic that is based on input from the person stepping through a case, phone call, or other customer interaction.

Dialogs are frequently used in call centers to provide scripts that allow customer facing staff to apply consistent interactions with customers. You can also use dialogs to provide a kind of ‘wizard’ user interface to allow people to perform complex procedures consistently.

Dialogs provide:
– Consistent customer interactions and interactive user tasks.
– Consistent information entry into your organization’s database.
– A way for people in your organization to focus on growing your business, instead of performing repetitive tasks.

Dialogs display a series of screens based on the responses you enter to the prompts on each screen. The dialog can provide a different set of screens based on the responses you enter. After the dialog is complete, the data is saved and can be reviewed later.

Unlike workflow processes, a dialog can only be applied to one record at a time.

1. Where do I customize dialog processes?
You can see the dialogs in your organization by navigating to Settings -> Processes and filtering on processes in the Dialog category. You can also see the dialogs in your organization by viewing the Processes node in the default solution and filtering on processes in the Dialog category.

2. Dialog properties
Every dialog must have the following properties set:
Dialogs1
– Name: The name of the dialog process doesn’t need to be unique, but if you expect you’ll have a lot of dialogs, you may want to use a naming convention to clearly differentiate your processes. You may want to apply standard prefixes to the name of the dialog. The prefix may describe the function of the workflow or the department within the company. This will help you group similar items in the list of dialogs
– Entity: Each dialog process must be set to a single entity. You can’t change the entity after the dialog is created.
– Category: This property establishes that this is a Dialog process.
Unlike workflow processes, dialogs do not have scope. They are available to the entire organization. If a user runs a dialog that creates or updates record, the user must have privileges to perform those actions outside the dialog. Each dialog will create a Dialog session record and the user must have privileges to create and update those records.

3. Activating dialogs
Before you can use a dialog, you have to activate it. A dialog can only be activated or deactivated by the dialog owner. You can reassign a dialog by changing the owner. You can do this on the Administration tab. Dialogs can only be edited while they are deactivated. If you need to edit a dialog that is owned by another user, have them deactivate it and assign it to you.

4. Configure dialog processes
Dialogs provide a user interface to people who use them. You need to be familiar with what is possible within this user interface as you configure dialogs to meet your business requirements.

 4.1 Dialog components: It is helpful to see what a dialog looks like to people using them before you start configuring your first one. When you open a dialog process to use it you will see a window like the one shown in the following screenshot:
Dialogs2

A dialog will have the following components:

Header: Includes the name of the Dialog and the name of the current page.
Prompt and Response: Shows each of the prompts and responses added to the page. The prompts tell the user what to do or say, and the responses provide a place to enter data that could be used to set a value in a CRM record or just to control the flow of the dialog. Responses are optional.
Tip: Provides additional detail not included in the prompt. The tip shown changes depending on which prompt has focus.
Comments: Use comments to capture information that will remain available as you progress through the dialog. You might want to type notes in this comments section to provide additional detail not captured in the responses.
Help: Opens the Microsoft Dynamics CRM application help topic for dialogs.
Summary: Opens the dialog session. The Dialog session displays the data captured by the dialog. While you are using a dialog, the session will show the data set for previous pages.
Previous: After the first page of the dialog you can use this button to go to previous pages.
Next: Advances to the next dialog page.
Finish: After the last dialog page, this button will close the dialog with a status of completed.
Cancel: Closes the dialog with a status of cancelled. It is not possible to resume a cancelled dialog.

To configure a dialog after it is created you will view a page like the following screen that contains data from a Page containing a ‘Prompt and Response’.
Dialogs3
Like other processes, you can change the name, activate as a process template and configure the process to run as either an on-demand process or a child process. If you leave both of the ‘Available To Run’ options unchecked when you activate the dialog, it will be set as an on-demand process.
‘Input Arguments’ are only used for processes that are configured to be used as a child process.
Use ‘Variables’ to set values that are stored within the dialog process. Variables are useful when a process gathers data through the course of several pages and this data may be used to perform calculations. For example, a dialog might be used to calculate a standard rating value based on the answers to several questions.

4.2 Steps available for dialogs: Most of the steps available for dialogs are the same as those common for processes with the exception of Page, Prompt and Response, Link Child Dialog, and Query CRM Data.
4.2.1 Page: Page is a container for Prompt and Response steps. You must include a Page before you can add a Prompt and Response.
 4.2.2 Prompt and response: The ‘Prompt and Response’ step properties are the most important parts of the dialog. You must add at least one prompt and response step before the dialog can be activated.
Tip: Don’t add too many Prompt and Response steps to a single page because it will require the user to scroll down the page. It is better to add additional pages so that people can click through the pages without scrolling.
After you add a prompt and response, click ‘Set Properties’ to open the ‘Define Prompt and Response’ dialog.
Dialogs4
A ‘Prompt and Response’ step has the following properties:
Dialogs5
4.2.2.1 Statement Label: The statement label should provide an appropriate heading for the Prompt Text. The Statement Label is visible in the dialog session when viewing the summary during or after the dialog is completed.
4.2.2.2 Prompt Text: Prompt Text may represent something the person using the dialog should say to the customer or it could include instructions about how to complete a step of a complex procedure
4.2.2.3 Tip text: Tip text provides additional information to support the Prompt Text.
4.2.2.4 Response Type: Choose one of the following Response Types:
None: You can add a prompt without a response.
Single Line: A single line can represent a text, integer or float data by setting the Data Type.
Option Set (Radio Buttons): The results are presented as a set of Radio buttons. Use this option when there are just a small number of options to choose from. The data selected can be set to either text, integer or float data by setting the Data Type. You can choose to define static values or query CRM Data to provide a list of options.
Options Set (Picklist): This is exactly like Option Set (Radio Buttons), except that the options are displayed as a list. Use this option when there are very many options to choose from.
Multiple Lines (Text Only):Provides an area to type text with multiple lines.
Date and Time: Provides a control to set a date and a time.
Date only: Provides a control to set a date.
Lookup: This option will present one of the lookup fields used in the application. When you select this option the following fields appear and you must provide values for them:
Reference Entity: An entity that contains the lookup you want to use
Reference Field: The specific lookup in the reference entity that you want to use.
Tip: If you want to have a list for an entity that has no many-to-one entity relationships, you can create a custom entity and then create a one-to-many relationship between it and the entity that you want to appear in the list. Since this custom entity has no other purpose than to allow this lookup, make sure to configure it so that it is not visible in the application and set the entity description to indicate the purpose of the entity.

4.2.2.5 Data Type: When you select a ‘Response Type’ of Single Line, Option Set (radio buttons), or Option Set (picklist), you can choose to have the data set in the control be expressed using one of the following data types: Text, Integer, Float
When you select a ‘Response Type’ of Lookup, the Data Type field is replaced by the Reference Entity field.
 4.2.2.6 Log Response: When you choose to not log responses you will still be able to access the responses as variables within your dialog, but the data in the response will not be saved with the dialog session. This is a security feature. Consider if you have a dialog that requires some personal information to be entered and processed. If the response is not logged it will not be saved with the dialog session record that contains the data in the dialog summary.
4.2.2.7 Default value: Use default value to set a value to indicate that the data in the response was not provided or represents a very common response which would only need to be edited if it was different.
4.2.3 Link child dialog: In the same way you might use child Workflows, you can also define child dialogs to create re-usable dialogs that you can re-use from other dialogs. If the child dialog has any input parameters, when you call the child dialog you need to map any available variables or responses to the input variables defined for the child dialog.

– Setting input arguments for a child process: If you attempt to enter Input arguments for a process configured as an on-demand process, you will be prompted to change the ‘Available to Run’ value to ‘As a Child Process’. After you enter Input arguments, you will not be able to set the process to be an on-demand process until all the input arguments have been removed.

Input arguments can be of the following types:
– Single Line of Text
– Whole Number
– Floating Point Number
– Date and Time
– Date Only
– Lookup
With each type, you can set a default value to be used if the calling dialog doesn’t provide data to the input argument.

4.2.4 Query CRM Data: If your dialog depends on the ability to display some data that is retrieved from CRM you should add a ‘Query CRM Data’ step before you need to view this data as either of the Option Set response types.

When you define a query you are shown a screen based on the ‘Advanced Find’ page. You can define a new query or use one of the existing views. When any of the queries requires setting a specific value, that value is considered a variable. For example, you can create a query that shows all the Case records where a specific Account is the Customer. For the query to work, you must specify an Account Record to be the placeholder. Then, when you select the Modify Query Variables tab you will see the FetchXML representation of the query with a variable generated where you had specified a specific Account in your query.

You need to use the Form Assistant to set a slug to represent the Account record that is the context of a Dialog defined for the account entity.

Dialogs6

After you have done this you can Save and Close the Query. If you click the ‘Design New’ tab at this point, your dynamic value set for this query will be removed and you will need to add it back again.
You can have a query with variables and not use a dynamic value, but then the results shown will be the same with every dialog.
– Using query variables: Once you have defined a query variable you will typically use in a response using the Options Set (picklist) Response Type. You can specify which of the columns in the query you want to display and some text to separate the values that are displayed on the list.
Dialogs7
The result is that in the dialog people can select from the results.
Dialogs8

Workflow processes in Dynamics CRM 2013

Workflows automate business processes without a user interface. People usually use workflow processes to initiate automation that doesn’t require any user interaction.
Though workflows are not new in Dynamics CRM 2013, however Microsoft introduced new feature in Dynamics CRM 2013 that allows users to create real-time/synchronous workflows.
Each workflow process is associated with a single entity. When configuring workflows you have four major areas to consider:

  • When to start them?
  • Should they run as a real-time workflow or a background workflow?
  • What actions should they perform?
  • Under what conditions should actions be performed?

1. Where do you customize workflow processes?
You can see the workflows in your organization by viewing the ‘Processes’ node in the ‘Default Solution’ and filtering on processes that have the ‘Category Workflow’.
Workflows1

2. Workflow properties
In the solution explorer, select ‘Processes’ and click ‘New’.
When you create a workflow the ‘Create Process’ dialog requires that you set three properties that all processes have:
Workflows2
– Process name: The name of the workflow process does not need to be unique, but if you expect you will have a lot of workflows, you may want to use a naming convention to clearly differentiate your processes. You may want to apply standard prefixes to the name of the workflow. The prefix may describe the function of the workflow or the department within the company. This will help you group similar items in the list of workflows.
– Category: This property establishes that this is a workflow process.
– Entity: Each workflow process must be set to a single entity. You can’t change the entity after the workflow process is created.
– Run this workflow in the background (recommended): This option appears when you select workflow as the category. This setting determines whether the workflow is a real-time or background workflow. Real-time workflows run immediately (synchronously) and background workflows run asynchronously. The configuration options available depend on your choice for this setting. Background workflows allow for wait conditions that are not available for real-time workflows. As long as you don’t use those wait conditions, at a later time you can convert background workflows to real-time workflows and real-time workflows to background workflows.
You also have the ‘Type’ option to specify whether to build a new workflow from scratch or choose to start from an existing template. When you choose ‘New process from an existing template (select from list)’ you can choose from the available Workflows processes that were previously saved as a process template.
After you create the Workflow or if you edit an existing one, you will have the following additional properties:
Workflows3
– Activate As: You can choose ‘Process template’ to create an advanced starting point for other templates. If you choose this option, after you activate the workflow it will not be applied but instead it will be available to select in the ‘Create Process’ dialog if you select ‘Type: New process from an existing template (select from list)’
Process templates are convenient when you have a number of similar workflow processes and want to define them without duplicating the same logic.
Note: Editing a process template does not change the behaviors of any other workflow processes previously created using it as a template. A new workflow created using a template is a copy of the content in the template.
– Available to Run: This section contain options that describe how the workflow is available to be run.
– Run this Workflow in the background (recommended):This check box reflects the option you selected when you created the workflow. This option is disabled, but you can change it from the ‘Actions’ menu by choosing either ‘Convert to a real-time workflow’ or ‘Convert to a background workflow’.
– As an on-demand process: Choose this option if you want to allow users to run this workflow from the ‘Run Workflow’ command.
– As a child process: Choose this option if you want to allow the workflow to be available to be started from another workflow.
– Scope: For user-owned entities, options are Organization, Parent: Child Business Units, Business Unit, or User. For Organization-owned entities the only option is Organization.
If scope is Organization, then the workflow logic can be applied to any record in the organization. Otherwise, the workflow can only be applied to a subset of records that fall within the scope.
Note: The default scope value is User. Make sure you verify that the scope value is appropriate before you activate the workflow.
– Start When: Use the options in this section to specify when a workflow should start automatically. You can configure a real-time workflow to be run before certain events. This is a very powerful capability because the workflow can stop the action before it occurs.

  • Record is created
  • Record status changes
  • Record is assigned
  • Record fields change
  • Record is deleted

Note: Keep in mind that the actions and conditions you define for the workflow are not aware of when the workflow is run. For example, if you define a workflow to update the record, this action can’t be performed by a real-time workflow before the record is created. A record that doesn’t exist cannot be updated. Similarly, a background workflow can’t update a record that has been deleted, even though you could define this action for the workflow. If you configure a workflow to perform an action that can’t be performed, it will fail and the entire workflow will fail.
– Execute As: This option is only available if you unselected the ‘Run this workflow in the background (recommended)’ option when you created the workflow or if you later converted a background workflow to be a real-time workflow.

3. Security context of workflow processes
When a background workflow is configured as an on-demand process and is started by a user using the Run Workflow’ command, the actions that the workflow can perform are limited to those the user could perform based on the privileges and access levels defined by the security role(s) set for their user account.
When a background workflow starts based on an event the workflow operates in the context of the person who owns it, usually the person who created the workflow.
For real-time workflows you have the Execute As’ option and you can choose whether the workflow should apply the security context of the owner of the workflow or the user who made changes to the record. If your workflow includes actions which all users would not be able to perform based on security constraints, you should choose to have the workflow run as the owner of the workflow.

4. Activate a workflow
Workflows can only be edited while they are deactivated. Before a workflow can be used manually or be applied due to events it has to be activated. Before a workflow can be activated it must contain at least one step.
A workflow can only be activated or deactivated by the workflow owner or by someone with the Act on Behalf of Another User’ privilege such as the system administrator.  The reason for this is that a malicious user could modify someone’s workflow without them being aware of the change. You can reassign a workflow you own by changing the owner. This field is on the Administration’ tab. If you are not the system administrator and you need to edit a workflow that has to owned by another user, you need them to deactivate it and assign it to you. After you finish editing the workflow, you can to assign it back to them and they will need to activate it.
Real-time workflows require that the user have the ‘Activate Real-time Processes’ privilege. Because real-time workflows have a greater risk of affecting system performance, only people who can evaluate the potential risk should be given this privilege.
Workflows are saved when they are activated, so it is not necessary to save them before activating them.

5. Configure workflow steps
When configuring workflows you have four major areas to consider:

  • When to start them?
  • Should they run as a real-time workflow or a background workflow?
  • What actions should they perform?
  • Under what conditions actions should be performed?

 5.1 Workflow stages and steps: When you design workflows you have the option to contain the logic you want to perform in stages and steps.
Stages: Stages make the workflow logic easier to read, and explain the workflow logic. However, stages do not affect the logic or behavior of workflows. If a process has stages, all the steps within the process must be contained with a stage.
Steps: Steps are a unit of business logic within a workflow. Steps can include conditions, actions, other steps, or a combination of these elements.
5.2 Actions that workflow processes can perform: Workflow processes can perform the actions listed in the following table.

Action Description
Create Record Creates a new record for an entity you choose and assigns values you choose to attributes.
Update Record You can update the record that the workflow is running on, any of the records linked to that record in an N:1 relationships, or any records created by earlier steps.
Assign Record You can assign the record that the workflow is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Send Email Sends an email. You can choose to create a new email message or use an email template configured for the entity of the record that the workflow is running on or any entities that have an N:1 relationship with the entity, or the entity for any records created by earlier steps.
Start Child Workflow Starts a workflow process that has been configured as a child workflow.
Change Status Changes the status of the record that the process is running on, any of the records linked to that record with an N:1 relationship, or any records created by earlier steps.
Stop Workflow Stops the current workflow. You can set a status of either Succeeded or Cancelled and specify a status message.When real-time workflows are configured for an event, stopping a workflow with a status of cancelled will prevent the event action from completing.
Custom Step Developers can create custom workflow steps that define actions. There are no custom steps available in Microsoft Dynamics CRM by default.

5.3 Setting record values: When you create a record you can set values for the record. When you update a record you can set, append, increment, decrement, multiply, or clear values.
When you click ‘Set Properties’, a dialog opens showing you the default form for the entity.
At the bottom of the dialog you can see a list of additional fields not present in the form.
For any field, you can set a static value and that will be set by the workflow.
On the right side of the dialog the ‘Form Assistant’ gives you the ability to set or append dynamic values from the context of the current record. This includes values from related records that can be accessed from the N:1 (many-to-one) relationships for the entity.
The options available in the ‘Form Assistant’ depend on the field you have selected in the form. When you set a dynamic value, you will see a yellow placeholder known as a ‘slug’ that shows where the dynamic data will be included. If you want to remove the value, just select the slug and delete it. For text fields, you can use a combination of static and dynamic data.
With dynamic values you don’t know for certain that a field or related entity has the value you want to set. You can actually set a number of fields to try and set the value and sort them in order using the green arrows. If the first field doesn’t have data, the second field will be tried and so on. If none of the fields have data, you can specify a default value to be used.
5.4 Setting conditions for workflow actions: The actions that you will apply often depend on conditions. Workflow processes provide several ways to set conditions and create branching logic to get the results you want. You can check values of the record that the workflow process is running against, any of the records linked to that record with an N:1 relationship, or values within the process itself

Condition Type Description
Check Condition A logical “if-<condition> then” statement.
You can check values for the record that the workflow is running on, any of the records linked to that record in an N:1 relationships, or any records created by earlier steps. Based on these values you can define additional steps when the condition is true.
Conditional Branch A logical “else-if-then” statement, the editor uses the text “Otherwise, if <condition> then:”
Select a check condition you have previously defined and you can add a conditional branch to define additional steps when the check condition returns false.
Default Action A logical “else” statement. the editor uses the text “Otherwise:”
Select a check condition, conditional branch, wait condition, or parallel wait branch that you have previously defined and you can use a default action to define steps for all cases that do not match the criteria defined in condition or branch elements.
Wait Condition Enables a background workflow to pause itself until the criteria defined by the condition have been met. The workflow starts again automatically when the criteria in the wait condition have been met.
Real-time workflows cannot use wait conditions.
Parallel Wait Branch Defines an alternative wait condition for a background workflow with a corresponding set of additional steps that are performed only when the initial criterion is met. You can use parallel wait branches to create time limits in your workflow logic. They help prevent the workflow from waiting indefinitely until the criteria defined in a wait condition have been met.
Custom Step Developers can create custom workflow steps that define conditions. There are no custom steps available in Microsoft Dynamics CRM by default.

5.5 Using real-time workflows: With Microsoft Dynamics CRM 2013 you can configure real-time workflows but you should use them with care. Background workflows are generally recommended because they allow the system to apply them as resources on the server are available. This helps smooth out the work the server has to do and help maintain the best performance for everyone using the system. The drawback is that actions defined by background workflows are not immediate. You can’t predict when they will be applied, but generally it will take a few minutes. For most automation of business processes this is fine because people using the system don’t need to be consciously aware that the process is running.

Use real-time workflows when a business process requires someone to immediately see the results of the process or if you want the ability to cancel an operation. For example, you may want to set certain default values for a record the first time it is saved, or you want to make sure that some records are not deleted.

6. Converting between real-time and background workflows:
You can change a real-time workflow into a background workflow by choosing ‘Convert to a background workflow’ on the toolbar.
You can change a background workflow into a real-time workflow by choosing ‘Convert to a real-time workflow’ on the toolbar. If the background workflow uses a wait conditions it will become invalid and you won’t be able to activate it until you remove the wait condition.

7. Initiating real-time workflows before or after status changes:
When you configure ‘Options for Automatic Processes’ for real-time workflows, the ‘Start When’ options for the status changes event let you select ‘After’ or ‘Before’ for when status changes. The default option is ‘After’.
When you select ‘Before’ you are saying that you want the logic in the workflow to be applied before data changing the status is saved. This provides you with the ability to check the values before other logic has been applied after the operation and prevent further logic from being performed. For example, you may have additional logic in a plugin or custom workflow action which could initiate actions on another system. By stopping further processing you can avoid cases where external systems are affected. Applying real-time workflows before this event also means that other workflow or plug-in actions in Microsoft Dynamics CRM that may have saved data don’t need to be “rolled back” when the operation is canceled.

8. Using the Stop Workflow action with real-time workflows
When you apply a ‘Stop Workflow’ action in a workflow you have the option to specify a status condition that can be either ‘Succeeded’ or ‘Canceled’. When you set the status to canceled, you prevent the operation. An error message containing the text from the stop action status message will be displayed to the user with the heading ‘Business Process Error’.

Reports in Dynamics CRM 2013

Microsoft Dynamics CRM 2013 includes reports that provide useful business information to the user. These reports are based on Microsoft SQL Server Reporting Services, and provide the same set of features that are available for the Microsoft SQL Server Reporting Services reports. The report definition (data and layout) of Microsoft Dynamics CRM reports are contained in an .rdl file, and the contents of the .rdl file conform to the Microsoft SQL Server Report Definition Language Specification.

1. System Reports (Out-of-box Reports):

Dynamics CRM 2013 comes with 25 out-of-box reports for viewing your business data. The following table shows a list of available reports and what data they get when you run.

Name Description
Account Distribution Identify patterns in top revenue-generating accounts.
Account Overview View a one-page overview of an account.
Account Summary View a chronological summary of an account.
Activities Display a list of activities.
Campaign Activity Status Track campaign activities.
Campaign Comparison Compare two campaigns.
Campaign Performance Track the progress and status of campaigns.
Case Summary Table View the patterns in cases.
Competitor Win Loss Compare how your sales team performs against competitors.
Invoice View an invoice and its line items.
Invoice Status View your accounts receivable.
Lead Source Effectiveness Compare your lead sources.
Neglected Accounts Identify accounts that have not been contacted recently.
Neglected Cases Identify cases that have not been contacted recently.
Neglected Leads Identify leads that have not been contacted.
Order View an order and its line items.
Products By Account View products that are used by an account.
Products By Contact View products that are used by a contact.
Progress against goals View progress against goals
Quote View a quote and its line items.
Sales History Understand past sales performance.
Sales Pipeline View anticipated potential sales.
Service Activity Volume View the patterns in service activity volume.
Top Knowledge Base Articles Identify the most frequently used knowledge base articles.
User Summary View user contact and security role information.

Reports1

2. Custom Reports:

You can also create custom reports in Dynamics CRM 2013, there are two types of custom reports you can create in Dynamics CRM 2013: Fetch-based and SQL-based.

Fetch-based: Fetch-based custom reports use FetchXML queries, which are proprietary to Microsoft Dynamics CRM, to retrieve data for reports. These reports are introduced in Microsoft Dynamics CRM 2011 and use FetchXML queries to retrieve data for reports. You can deploy custom fetch-based reports to Microsoft Dynamics CRM Online and to on-premises Microsoft Dynamics CRM 2011. All reports that are created using the Report Wizard in the Microsoft Dynamics CRM 2011 are Fetch-based reports. You can deploy custom Fetch-based reports to Microsoft Dynamics CRM Online and On-Premises.

SQL-based: These reports use SQL queries to securely retrieve data for reports from filtered views defined by the system. These are the same reports that have been available for previous versions of Microsoft Dynamics CRM. The default reports that are shipped with Microsoft Dynamics CRM 2011 are SQL-based reports. You cannot deploy custom SQL-based reports to Microsoft Dynamics CRM Online.

Use SQL and filtered views to retrieve data for reports: Microsoft Dynamics CRM data and metadata are stored in a Microsoft SQL Server database named <organization_name>_MSCRM on the server that is running Microsoft SQL Server in the Microsoft Dynamics CRM installation. SQL-based reports in Microsoft Dynamics CRM use the filtered views provided for each entity to retrieve data for the reports. Filtered views are fully compliant with the Microsoft Dynamics CRM security model. When you run a report that obtains data from filtered views, the Microsoft Dynamics CRM security role determines what data you can view in the report. Data in filtered views is restricted at these levels: the organization, the business unit, the owner, and at the field level.

Filtered views exist for all Microsoft Dynamics CRM entities, including custom entities. Your custom SQL-based reports cannot read data directly from the Microsoft Dynamics CRM database tables. Instead, you must use the filtered views to retrieve data for your custom SQL-based reports.

The following sample SQL code returns all columns from the filtered view for an Account entity:

SELECT * FROM dbo.FilteredAccount

Filtered views also provide a way to pull Microsoft Dynamics CRM report data into Microsoft Office applications, such as Microsoft Office Excel and Microsoft Access. For a complete listing of all the standard filtered views organized by product area

Differences between the RDL File of SQL-based and Fetch-based reports: The following table lists the differences between .rdl files of SQL-based and Fetch-based reports in Microsoft Dynamics CRM.

SQL-based Report Fetch-based report
The <DataProvider> element value in the .rdl file is set to SQL. For example:

<DataProvider>SQL</DataProvider>

The <DataProvider> element value in the .rdl file is set to MSCRMFETCH. For example:

<DataProvider>MSCRMFETCH</DataProvider>

The query specified for retrieving data is in the <CommandText> sub-element under the <Query> element in the report definition (.rdl file) is a SQL query. For example, the query for retrieving all account names for a SQL-based report will be:

<CommandText>SELECT name FROM FilteredAccount;</CommandText>

The query specified for retrieving data is in the <CommandText> sub-element under the <Query> element in the report definition (.rdl file) is a FetchXML query. For example, the query for retrieving all account names for a Fetch-based report will be:

<CommandText><fetch version=”1.0″ output-format=”xml-platform” mapping=”logical”><entity name=”account”><attribute name=”name” /> </entity></fetch></CommandText>

Import, update, and export solutions in Dynamics CRM 2013

How often you import, update, or export solutions may depend on the size of your organization, your internal development practices, and whether you are developing a solution that is to be distributed as a managed solution.

  • If you have a small organization with few customizations, and you’re the only customizer, you may never export or import solutions except to periodically export the default solution to create a backup or if you choose to use or buy a managed solution provided by someone else.
  • Some organizations will have an outside company create customizations for them. In this case, they’ll export any customizations that they currently have and send them to the outside company. That company will develop and test customizations and send them back to the organization to be imported.
  • Large organizations may have several teams of people customizing the system. They may have a separate organization just for development and customizations. These organizations frequently also have a separate test organizations and a UAT (User Acceptance Testing) organizations in addition to a production organization which everyone in the organization actually uses. These organizations depend on exporting and importing customizations from one organization to the next in the process of creating, testing, and verifying the solutions.

The strategy you choose should depend on your needs. Some important things to keep in mind:

  • You can’t export your default solution as a managed solution.
  • We don’t support importing a default solution taken from an on-premise deployment into a CRM Online organization or a default solution taken from a CRM Online organization into an on-premises deployment. We do support importing custom solutions between these deployment types, but not default solutions.
  • Custom solutions developed using Microsoft Dynamics CRM 2011 can be imported into Microsoft Dynamics CRM 2013 and Microsoft Dynamics CRM Online organizations.
  • Custom solutions developed using future versions of Microsoft Dynamics CRM cannot be installed into earlier versions without first being ‘down-leveled’ to match the earlier version.
  • When you export a managed solution, you can’t import it back into the organization it was imported from.
  • Only export a solution as a managed solution when you intend to distribute it.
  • Never import an unmanaged solution unless you are sure you want to accept all the customizations in it and allow any of those customizations to overwrite any customizations you previously created.
  • Solutions can’t delete anything. Importing an unmanaged solution might overwrite existing customizations, but it can’t entirely remove them. For example, if you create a custom field for an entity, and then import a solution containing the definition of that entity that doesn’t have the custom field, the custom field you created will still be there. Also, any changes defined within the solution you imported will be there.
  • You can’t import a custom entity with the same name as an existing entity. Microsoft Dynamics CRM allows duplicate display names, though.
  • You must have the System Administrator security role to import security roles, organization settings, sdk message processing steps, and plug-in assemblies.
  • If you import customizations that include a language that is not installed on your system, any labels defined in the customizations will default to the base language of the Microsoft Dynamics CRM system the customizations were imported from.
  • All imported security roles will be attached to the root business unit.
  • If an imported security role originated from the same CRM system, any changes applied to the security role will be merged. All privileges on system entities for the security role will be replaced by privileges defined by the security role that is being imported.

1. Import Solutions:

You can import solutions manually using the steps below. Only import solutions that you’ve obtained from a trusted source. Customizations might include code that can send data to external sources.
IUESolutions1
1. Navigate to Settings -> Solutions.
2. In the solutions list menu choose Import.
3. In the Import Solution dialog, Select Solution Package step browse to the compressed (.zip or .cab) file that contains the solution you want to import.
4. Click Next
5. You can view information about the solution before you click Import.
6. You may need to wait a few moments while the solution import completes. If it is successful, you can view the results and click Close.
If you have imported any changes that require publishing, you must publish customizations before they will be available.

If the import isn’t successful, you will see a report showing any errors or warnings that were captured. You can click Download Log File to capture details about what caused the import to fail. The most common cause for a solution import to fail is that the solution did not contain some required solution components.

When you download the log file, you will find an XML file that you can open using Microsoft Office Excel and view the contents.

2. Update Solutions:

There are times when you may wish to install an update to an existing managed solution. The procedure is similar to installing a new managed solution, except you will get some different options. If you are updating a solution you got from someone else, you should get guidance from the solution publisher about which options you should choose.

1. Navigate to Settings -> Solutions.
2. In the solutions list menu choose Import.
3. In the Import Solution dialog, Select Solution Package step browse to the compressed (.zip or .cab) file that contains the solution you want to update.
4. Click Next
5. You can view information about the solution before you click Next. This page will display a yellow bar saying This solution package contains an update for a solution that is already installed.
 IUESolutions2
6. You will have the following options:

  • Maintain customizations (recommended): Selecting this option will maintain any unmanaged customizations performed on components but also implies that some of the updates included in this solution will not take effect.
  • Overwrite Customizations: Selecting this option overwrites any unmanaged customizations previously performed on components included in this solution. All updates included in this solution will take effect.

Choose the appropriate option and then click Next.
7. You may need to wait a few moments while the solution import completes. If it is successful, you can view the results and click Close.
 If you have imported any changes that require publishing, you must publish customizations before they will be available.

Solution publishers may ask you to export your existing unmanaged customizations, update their managed solution using the option to overwrite customizations, and then re-import your unmanaged customizations. This will help ensure that the changes they are expecting are applied while preserving your customizations.

3. Export Solutions:

We recommend that you export your unmanaged customizations periodically so that you have a backup in case anything happens. You cannot export managed solutions.

1.    Navigate to Settings -> Solutions.
2.    In the list select the solution you want to export and click Export.
3.    In the Publish Customizations step you will be reminded that only published customizations are exported and you will have the option to Publish All Customizations before you click Next.
4.    If your solution contains any missing required components you will see the Missing Required Components step. You can disregard this warning only if you intend to import this as an unmanaged solution back into the original organization. Otherwise, follow the instructions in the dialog to cancel the export and add the required components.
5.    In the Export System Settings (Advanced) step you can choose certain system settings to include in your solution. If your solution depends on any of the groups of system settings, select them and click Next. See Settings options for solution export for details about the settings that will be included with each option.
6.    In the Package Type step, you must choose whether to export the solution as an Unmanaged or Managed solution.
7. Click Export to download the solution file.

The exact behavior for downloading files varies between browsers.

 4. Settings options for solution export: The following table shows the options available when you export a solution, based on your selection following system settings will be applied when solution is imported.

IUESolutions3

Group Setting Description
Auto-numbering Campaign Prefix Prefix used for campaign numbering.
Case Prefix Prefix to use for all cases throughout Microsoft Dynamics CRM.
Contract Prefix Prefix to use for all contracts throughout CRM.
Invoice Prefix Prefix to use for all invoice numbers throughout CRM.
Article Prefix Prefix to use for all articles in CRM.
Order Prefix Prefix to use for all orders throughout CRM.
Unique String Length Number of characters appended to invoice, quote, and order numbers.
Calendar Calendar Type Calendar type for the system. Set to Gregorian US by default
Date Format Code Information about how the date is displayed throughout Microsoft CRM.
Date Separator Character used to separate the month, the day, and the year in dates throughout CRM.
Max Appointment Duration Maximum number of days an appointment can last.
Show Week Number Information that specifies whether to display the week number in calendar displays throughout CRM.
Time Format Code Information that specifies how the time is displayed throughout CRM.
Week Start Day Code Designated first day of the week throughout CRM.
Customization Is Application Mode Enabled Indicates whether loading of CRM in a browser window that does not have address, tool, and menu bars is enabled.
Allow Unresolved Address E-mail Send Indicates whether users are allowed to send e-mail to unresolved parties (parties must still have an email address).
Ignore Internal E-mail Indicates whether incoming e-mail sent by internal CRM users or queues should be tracked.
Max Tracking Number Maximum tracking number before recycling takes place
Render Secure Frame For E-mail Flag to render the body of e-mail in the webform in an IFRAME with the security=’restricted’ attribute set. This is additional security but can cause a credentials prompt.
Tracking Prefix History list of tracking token prefixes.
Tracking Token Base Base number used to provide separate tracking token identifiers to users belonging to different deployments.
Tracking Token Digits Number of digits used to represent a tracking token identifier.
General Block Attachments Prevent upload or download of certain attachment types that are considered dangerous.
Currency Format Code Information about how currency symbols are placed throughout CRM.
Currency Symbol Currency Symbol
Full Name Display Order Order in which names are to be displayed throughout CRM.
Is Get Started Pane Content Enabled Get Started Pane was removed with Microsoft Dynamics CRM 2013 and Microsoft Dynamics CRM Online.
Presence Enabled Information on whether IM presence is enabled.
Negative Format Information that specifies how negative numbers are displayed throughout CRM.
Number Format Specification of how numbers are displayed throughout CRM.
Pricing Decimal Precision Number of decimal places that can be used for prices.
Share To Previous Owner On Assign Information that specifies whether to share to previous owner on assign.
Marketing Allow Automatic Response Creation Indicates whether automatic response creation is allowed
Allow Automatic Unsubscribe Indicates whether automatic unsubscribe is allowed.
Allow Automatic Unsubscribe Acknowledgement Indicates whether automatic unsubscribe acknowledgement email is allowed to send.
Allow Marketing E-mail Execution Indicates whether marketing e-
Outlook Synchronization Allow Address Book Synchronization Indicates whether background address book synchronization in Microsoft Office Outlook is allowed.
Allow Offline Scheduled Synchronization Indicates whether background offline synchronization in Microsoft Office Outlook is allowed.
Allow Scheduled Synchronization Indicates whether scheduled synchronizations to Outlook are allowed.
E-mail Send Polling Frequency Normal polling frequency used for sending email in Outlook.
Min Address Synchronization Frequency Normal polling frequency used for address book synchronization in Outlook.
Min Offline Synchronization Frequency Normal polling frequency used for background offline synchronization in Outlook.
Min Synchronization Frequency Minimum allowed time between scheduled Outlooksynchronizations.
Auto-Tag Max Cycles Maximum number of aggressive polling cycles executed for e-mail auto-tagging when a new email is received.
Auto-Tag Interval Normal polling frequency used for email receive auto-tagging in outlook.
Relationship Roles Relationship Role Settings Relationship roles is a feature that was deprecated in Microsoft Dynamics CRM 2011 and replaced with the Connections feature. People who upgraded from Microsoft Dynamics CRM 4.0 could continue using Relationship Roles with Microsoft
ISV Config Service Calendar Appearance Configuration In Microsoft Dynamics CRM 4.0 ISV Config provided all the capabilities to create custom buttons and form navigation capabilities. In Microsoft Dynamics CRM 2011 all these capabilities were moved to other areas leaving behind only the ability to define visual styles for service calendars.

Solutions in Dynamics CRM 2013

1. Solutions:
Solutions exist so that a set of customizations can be purchased, shared or otherwise transported from one organization to another. You can get solutions in the Microsoft Dynamics Marketplace or from an independent software vendor (ISV). A CRM solution is a file that you can import to apply a set of customizations.
If you are just interested in customizing your organization, here is what you need to know about solutions:

  • Creating solutions is optional. You can customize your CRM system directly without ever creating a solution.
  • When you customize the CRM system directly, you work with a special solution called the Default Solution. The Default Solution contains all the components in your system.
  • You can export your Default Solution to create a backup of the customizations you have defined in your organization. This is good to have in a worst case scenario.

2. Solution Components:
A solution component represents something that you can potentially customize. Anything that can be included within a solution is a solution component.
Solutions1
The following is a list of solution components that you can view within a solution:

  1. Application Ribbon
  2. Article Template
  3. Business Rule
  4. Chart
  5. Connection Role
  6. Contract Template
  7. Dashboard
  8. Email Template
  9. Entity
  10. Entity Relationship
  11. Field
  12. Field Security Profile
  13. Form
  14. Mail Merge Template
  15. Message
  16. Option Set
  17. Plug-in Assembly
  18. Process
  19. Report
  20. Sdk Message Processing Step
  21. Security Role
  22. Service Endpoint
  23. Site Map
  24. Web Resource

Most solution components are nested within other solution components. For example, an entity contains forms, views, charts, fields, entity relationships, messages and business rules. Each of those solution components requires an entity to exist. A Field can’t exist outside of an entity. We say that the Field is dependent on the Entity. There are actually twice as many types of solution components as shown in the list above, but most of them are not visible in the application.
The purpose of having solution components is to keep track of any limitations on what can be customized using Managed properties and all the Solution dependencies so that it can be exported, imported, and (in managed solutions) deleted without leaving anything behind.

3. Managed and unmanaged solutions:
A managed solution can be uninstalled after it is imported. All the components of that solution are removed by uninstalling the solution.

When you import an unmanaged solution, you add all the components of that solution into your default solution. You can’t remove the components by uninstalling the solution.

When you import an unmanaged solution that contains solution components that you have already customized, your customizations will be overwritten by the customizations in the unmanaged solution. You can’t undo this.

Note: Install an unmanaged solution only if you want to add all the components to your default solution, and overwrite any existing customizations.

Even if you don’t plan on distributing your solution, you might want to create and use an unmanaged solution to have a separate view that only includes those parts of the application that you have customized. Whenever you customize something, just add it to the unmanaged solution that you created.

You can only export your Default Solution as an unmanaged solution.

To create a managed solution, you choose the managed solution option when you export the solution. If you create a managed solution, you can’t import it back into the same organization you used to create it. You can only import it into a different organization.

4. How solutions are applied:
All solutions are evaluated as layers to determine what your CRM application will actually do. The following diagram shows how managed and unmanaged solutions are evaluated and how changes in them will appear in your organization.
Solutions2
Starting from the bottom and working up to top:

– System solution:  The system solution is like a managed solution that every organization has. The system solution is the definition of all the out-of-the box components in the system.

– Managed Solutions:  Managed solutions can modify the system solution components and add new components. If multiple managed solutions are installed, the first one installed is below the managed solution installed later. This means that the second solution installed can customize the one installed before. When two managed solutions have conflicting definitions, the general rule is “Last one wins”. If you uninstall a managed solution, the managed solution below it takes effect. If you uninstall all managed solution, the default behavior defined within the System solution is applied.

– Unmanaged Customizations: Unmanaged customizations are any change you have made to your organization through an unmanaged solution. The system solution defines what you can or cannot customize by using Managed properties. Publishers of managed solutions have the same ability to limit your ability to customize solution components that they add in their solution. You can customize any of the solution components that do not have managed properties that prevent you from customization them.

– Application Behavior: This is what you actually see in your organization. The default system solution plus any managed solutions, plus any unmanaged customizations you have applied.

– Managed properties: Some parts of Microsoft Dynamics CRM can’t be customized. These items in the system solution have metadata that prevents you from customizing them. These are called managed properties. The publisher of a managed solution can also set the managed properties to prevent you from customizing their solution in ways they do not want you to.

– Solution dependencies: Because of the way that managed solutions are layered some managed solutions can be dependent on solution components in other managed solutions. Some solution publishers will take advantage of this to build solutions that modular. You may need to install a ‘base’ managed solution first and then you can install a second managed that will further customize the components in the base managed solution. The second managed solution depends on solution components that are part of the first solution.

CRM tracks these dependencies between solutions. If you try to install a solution that requires a base solution which is not installed, you will not be able to install the solution. You will get a message saying that the solution requires another solution to be installed first. Similarly, because of the dependencies, you cannot uninstall the base solution while a solution which depends on it is still installed. You have to uninstall the dependent solution before you can uninstall the base solution.

Every solution has a Publisher. The default solution has a publisher named “Default Publisher for <your organization name>”.

– Solution publisher: The publisher record contains a Prefix value. The default value of this prefix is “new”. When you create new solution components this prefix will be appended to the name. This is a quick way that allows people to understand what solution the components are part of.

Before you start customizing the system we recommend that you change the Prefix value for the default publisher to something that identifies your company.

To change the Solution Publisher Prefix for the default publisher:

1. Navigate to Settings -> Customizations.
2. Select Publishers.
3. If there is more than one publisher, open the one with the Display Name that starts with Default Publisher for <your organization name>.
4. At the bottom of the form update the Prefix field to change the default value of ‘new’ to something that identifies your organization.
5. When you change the value, make sure to tab to the next field. The Option Value Prefix will automatically generate a number based on the customization prefix. This number is used when you add options to option sets and provides an indicator of which solution was used to add the option.

5. Publishing customizations:
Certain customizations that make changes to the user interface require that they be published before people can use them in the application. Publishing provides a way for you to save your work before you have finished and then come back and finish at a later time. Publishing is only required when you change a solution component. When you create or delete a solution component publishing occurs automatically. Before you export a solution you will be prompted to publish customizations. This is because any unpublished customizations will not be included in the solution.

When you perform customizations that will appear in Microsoft Dynamics CRM for tablets you should always explicitly publish your customizations to make sure that every item is synchronized with the CRM for tablets application.

Note: Publishing customizations can interfere with normal system operation. In a production environment we recommend that you schedule publishing customizations when it’s least disruptive to users.
The following solution components require publishing when they are updated:

  • Application Ribbon
  • Entity
  • Entity Relationship
  • Field
  • Form
  • Message
  • Option Set
  • Site Map
  • Web Resource

Entity options in Dynamics CRM 2013

Entity options that can only be enabled: The following screenshot and table lists the options that you can enable for an entity, but after these items are enabled, they can’t be disabled:

EntityOptions1

Option Description
Business process flows Create business process flows for this entity.
Notes Append notes to records for this entity. Notes include the ability to add attachments.
Activities Associate activities to records for this entity.
Connections Use the connections feature to show how records for this entity have connections to records of other entities that also have connections enabled.
Sending e-mail (if an e-mail field does not exist, one will be created) Send emails using an email address stored in one of the fields for this entity. If a Single Line of Text field with format set to email doesn’t already exist for this entity, a new one will be created when you enable sending email.
Queues Use the entity with queues. Queues improve routing and sharing of work by making records for this entity available in a central place that everyone can access.

Enable or disable entity options: The following screenshot and table lists the entity options that you can enable or disable at any time.

EntityOptions2

Option Description
Primary Image System entities that support images will already have an Image field. You can choose whether to display data in this field as the image for the record by setting this field to [None] or Default Image.
For custom entities you must first create an image field. Each entity can have only one image field. After you create one, you can change this setting to set the primary image.
Mail Merge People can use this entity with mail merge.
Document Management After other tasks have been performed to enable document management for your organization, enabling this feature allows for this entity to participate in integration with Microsoft SharePoint.
Access Teams Create team templates for this entity.
Duplicate Detection If duplicate detection is enabled for your organization, enabling this allows you to create duplicate detection rules for this entity. For information about enabling duplicate detection.
Allow Quick Create After you have created and published a Quick Create Form for this entity, people will have the option to create a new record using the Create button in the navigation pane.
When this is enabled for a custom activity entity, the custom activity will be visible in the group of activity entities when people use the Create button in the navigation pane. However, because activities don’t support quick create forms, the main form will be used when the custom entity icon is clicked.
Auditing When auditing is enabled for your organization, this allows for changes to entity records to be captured over time. When you enable auditing for an entity, auditing is also enabled on all its fields. You can select or clear fields that you want to enable auditing on.
CRM for phones This entity will be available within the Microsoft Dynamics CRM for phones application.
CRM for Tablets This entity will be available using Microsoft Dynamics CRM for tablets. You also have the option to make this entity Read-only in CRM for tablets.
If the forms for an entity require an extension that isn’t supported by CRM for tablets, such as IFRAME or web resource controls, use this setting to ensure that the data for these entities is not editable by people using CRM for tablets.
Reading pane in CRM for Outlook Records for this entity can display in a read-only view in CRM for Outlook.
Offline capability for CRM for Outlook People using Microsoft Dynamics CRM for Outlook can choose to include data from this entity with the data they take offline.
Warning: Each entity that you enable for offline capability directly affects the time required for people to synchronize data when they come back online. This is especially true for people with less powerful computers. Carefully consider if an entity must be available for people while working offline.

Ready-to-use Business Processes in Dynamics CRM 2013

Microsoft Dynamics CRM includes several ready-to-use business processes for common sales, service, and marketing scenarios – to help you ensure that staff follows consistent steps every time they work with customers. Before you can use these processes, you need to add them to the system

Add Ready-to-use Business Processes:
1. On the navigation bar, click or tap Microsoft Dynamics CRM -> Settings.
2. Click or tap Settings -> Data Management.
3. Click or tap Add Ready-to-Use Business Processes.
Click or tap Add.

Ready-to-use1
Ready-to-use2Ready-to-use3

Ready-to-use business processes flows are activated automatically when you add them. If a ready-to-use business process includes workflows or portable business logic rules, you’ll need to activate those separately.

The following table shows a list of ready-to-use business processes and what they help you do.
Below screenshots shows list of ready-to-use business processes after installing.

Process Name Category Description
Contact to Order B2C – Fill Ship To fields WF Workflow A synchronous workflow that defaults the Ship To and Address fields on the Order form once the order is created.
In store excellence – create visit WF Workflow A synchronous workflow process that creates a store visit once the Order Priority is set to Default Value.
Opportunity to Invoice B2B – OrderToInvoice WF Workflow A synchronous workflow process that updates the Bill To fields on the new Invoice form.
Opportunity to Invoice B2B – QuoteToOrder WF Workflow A synchronous workflow process that updates the Ship To fields on the Order form based on quote values.
Opportunity to Invoice B2B – OptyToQuote WF Workflow A synchronous workflow process that updates the Description and Ship To fields on the Quote form based on opportunity values.
Service Appointment Scheduling_Create a follow up phone call Workflow A synchronous workflow process that creates a Phone Call if Case Follow up Task Created equals ‘Yes’
Upsell after service interaction – create upsell task WF Workflow Create an upsell task if the customer experience is good. For an unsatisfactory customer experience, a follow-up customer activity is also created.
Contact to order (Business-to-Business) Business Process Flow Target sales by using a consistent method to interact with customers.
Email sales campaign Business Process Flow Email prospects, create and qualify leads, develop opportunities, and then close deals.
Collaborative Selling Business Process Flow Collaborative sales helps sales people add other members of the organization to the sales team. The new members of the sales team are able to review the opportunity and their roles on a mobile device
Guided service case Business Process Flow Make sure that data is entered consistently for service cases, and that required activities are completed to resolve a case.
Phone sales campaign Business Process Flow Call prospects, create and qualify leads, develop opportunities, and then close deals.
Service appointment scheduling Business Process Flow Schedule service appointments, set up reminders, and make sure service activities are completed.
Marketing list builder Business Process Flow Create targeted marketing lists for accounts, contacts, or leads, add prospects, and gain manager approval.
Opportunity to invoice (Business-to-Business) Business Process Flow Follow a standard process for assessing needs, negotiating outcomes, fulfilling orders, and closing opportunities when selling to other businesses.
Service case upsell Business Process Flow Upsell additional products or services while resolving a customer’s service request.
Multichannel sales campaign Business Process Flow Contact prospects by phone and email, create and qualify leads, and then close deals.
In store excellence Business Process Flow Suggest orders for store owners and field personnel and gain acceptance from store managers for those orders
Upsell after service interaction Business Process Flow Turn a good service experience into an opportunity to upsell more products and services to the customer.

Ready-to-use4

Delete Ready-to-use Business Processes: Follow below steps to delete all ready-to-use business processes from the system.

1. On the navigation bar, click or tap Microsoft Dynamics CRM -> Settings.
2. Click or tap Settings -> Solutions.
3. Select the ‘BusinessProcesses’ solution and click on ‘Delete’ command to remove all Ready-to-use Business Processes.

Ready-to-use5

Data encryption in Dynamics CRM 2013

Microsoft Dynamics CRM 2013 uses standard SQL Server cell level encryption for a set of default entity attributes that contain sensitive information, such as user names and email passwords. This feature can help organizations meet FIPS 140-2 compliance.

For Microsoft Dynamics CRM Online, all new and upgraded organizations use data encryption.

For on-premises versions of Microsoft Dynamics CRM 2013, data encryption is not active by default for new or upgraded organizations. However, data encryption may be activated at any time.

Microsoft Dynamics CRM users who have the system administrator security role can activate data encryption or change the encryption key after data encryption is enabled in the Settings -> Data Management -> Data Encryption area. After you activate data encryption, you cannot turn it off.

DataEncryption1

DataEncryption2

Important: For on-premises versions of Microsoft Dynamics CRM:

  • Changing the encryption key requires SSL configured on the Microsoft Dynamics CRM website.
  • It is a best practice is to change the encryption key once every year.
  • The encryption key is required to activate data encryption when you import an organization database into a new deployment or a deployment that has had the configuration database (MSCRM_CONFIG) re-created after the organization was encrypted. You can copy the original encryption key to Notepad and paste it into the Settings -> Data Management -> Data Encryption dialog box after the organization import is completed.
  • When you re-enter the data encryption key, we recommend that you run the Microsoft Dynamics CRM web application using Internet Explorer to paste the encryption key into the Data Encryption dialog box.

Copy your organization data encryption key:

We strongly recommend that you make a copy of your data encryption key. This is particularly important for on-premises deployments that may need to reactivate data encryption after a redeployment or failure recovery.

Copy an organization data encryption key:

  1. Sign in to Microsoft Dynamics CRM as a user with the system administrator security role.
  2. Go to Settings -> Data Management -> Data Encryption.
  3. In the Data Encryption dialog box, select Show Encryption Key, in the Current encryption key box select the encryption key, and copy it to the clipboard.

Note: If the Microsoft Dynamics CRM website is not configured for HTTPS/SSL, the Data Encryption dialog box will not be displayed. For a more secure deployment, we recommend that you configure the website for HTTPS/SSL. However, if the website is not configured for HTTP/SSL, use a tool that can be used to modify CRM database tables, such as Microsoft SQL Server Management Studio or the Deployment Web Service, open the configuration database (MSCRM_CONFIG), and in the DeploymentProperties table, set DisableSSLCheckForEncryption to 1.

  1. Paste the encryption key in to a text editor, such as Notepad.
  2. As a best practice, save the text file that contains the encryption key on a computer in a secure location on an encrypted hard drive.

Merge Forms in Dynamics CRM 2013

The ability to merge main forms facilitates the upgrade process. Updated user experiences in Microsoft Dynamics CRM 2013 include new layouts and functionality in forms. This topic explains how you can merge existing forms to use the new layout optimized for this release.

MergeForms1

1. What to expect when you upgrade:

We understand that changes that occur during an upgrade can be disruptive and we have designed the form upgrade process to minimize this. Rather than force each organization to adopt all the changes and new features included in this release, we have designed a process to put you in control. People in your organization should be able to continue working with the system while you apply changes to allow them to use new capabilities.

Organizations who upgrade to Microsoft Dynamics CRM 2013 and Microsoft Dynamics CRM Online will be in two main groups:

  • Online organizations: Microsoft Dynamics CRM Online organizations using the Microsoft Dynamics CRM December 2012 Service Update who are upgrading to Microsoft Dynamics CRM Online Fall ‘13.
  • On-premises organizations: Microsoft Dynamics CRM 2011 on-premises organizations who are upgrading to Microsoft Dynamics CRM 2013.

When On-premises organizations are upgraded, they will continue to use the same main form definitions that they had before upgrading. Each entity has a main form named ‘Information’. They will also have some new forms added, but these forms will be in an inactive state so that people using the system will not be able to use them until they are activated. These new forms are named after the entity. For example, the Opportunity entity will have a new disabled ‘Opportunity’ main form and the pre-existing Opportunity ‘Information’ main form will remain active.

Online organizations already have updated main forms for the Contact, Opportunity, Lead, Account, and Case entities that follow the convention where they are named after the entity. When these organizations are updated to Microsoft Dynamics CRM Online Fall ‘13, these main forms will automatically be updated to use the latest form capabilities. These forms will remain active. For entities other than the Contact, Opportunity, Lead, Account, and Case entities, new main forms named after the entity will be added but will not be activated.

Note: If you are a CRM Online organization and you have customized any of the five updated forms, depending on the specific customizations you have applied, you may see a Conflicts tab added to your form. In this tab you will find any fields where the customizations could not be automatically merged into the new layout. To address this, simply edit the form and drag the fields to where you want them to be. Then delete the Conflicts tab.

After you upgrade, you can use the new capability to merge your existing main ‘Information’ forms into the new main form definitions. After you are satisfied with the conversion process for each entity, you can activate the new forms and deactivate the old forms.

2. Merging main forms to use the new layout:

You only need to merge forms for Updated Entities that you have customized. You do not need to do this right away, but you will need to do it sometime before the next major release of Microsoft Dynamics CRM.

When you view one of the updated forms using the form editor, you will see a Merge Forms button in the Upgrade group in the Home tab. Use this button and select one of your existing forms and click or tap Add.

At the bottom of the form, you will find the visual elements of the form you selected have been appended to the bottom of the current form. The only difference is that the header and footer elements from the old form will be added as separate tabs containing a section with the contents of each element.

What you can’t see so easily is that all the form script event handlers are also brought in and merged with the new form. There is a limit to the number of event handlers that can be merged. Each form can have up to 50 event handlers. If the total number of event handlers exceeds 50, the action will be canceled. You will need to remove some event handlers from the form you want to merge before you can merge it.

Once the new forms are merged, you need to move any of the form elements from the old form into the new form until all the added elements are gone. Remove any form elements you don’t need.

If your original form has any security roles assigned to it, be sure to apply the same security roles to the new form.

When you are finished, activate the new main form and deactivate the old one.

Activate or deactivate a main form:

1. In the solution explorer, expand the entities node and select the entity with the main form you want to activate or deactivate.
2. Select Forms to view the forms list. If you do not see the form you are looking for, check that the All Forms view is selected.
3. Select the view and, in the toolbar, choose either Activate or Deactivate.
Note: You must have at least one active main form for each entity. If you try to deactivate the only active main form, you will see an error message.
4. You must publish customizations before these settings take effect.