Quite often I have heard the need to insert dynamic hyperlinks to CRM records via workflow. Typical requirements I have seen include:
- Workflow should send an email with a link to the primary entity of the workflow.
- A dialog prompt page should provide a link to a CRM record that is related to the context of the dialog (for example a hyperlink to the primary customer of the account for which the dialog is executing).
In order to use the hyperlink utility follow these steps:
1. Download and import the CRM2011 Workflow Utilities CRM solution.
2. When designing your process insert a "Create HyperLink step" for each hyperlink you need to generate.
3. Configure the hyperlink step, you must provide the following configuration parameters:
- URL of the CRM Organization [Required]. This is usually http://crmserver:port/orgname, but you might have "https" or have no port number.
- HyperLink to primary entity or related entities [Required]. Select True for primary entity and False for related entities.
- Attribute name to related entity. If you are creating a hyperlink to a related entity, you must provide the attribute name that relates the two entities. For example, if the primary entity is account and you are creating a hyperlink to the primary contact, specify the "primarycontactid" attribute.
- HyperLink text. This is the text that the user will click in order to follow the hyperlink. For example, the text in the following hyperlink would be "Bing": Bing. If the hyperlink text is not provded (you leave it empty) then the text used will be the value of the primary field of the entity. For example if you create a hyperlink to an account named "ABC" then the text in the hyperlink will be "ABC".
5. Use your hyperlink in an e-mail. When configurin the "Send E-mail" workflow step, you can insert a dynamic expression that uses the "HtmlHyperLink" output from the previous step.
For more documentation on how to use the CRM 2011 Workflow Utilities visit the CodePlex project here. You can also download the source code if you need to achieve similar functionality but want to build your own solution.