Notify Salesperson of New Opportunity

If you have one person working the leads (i.e. Telemarketer) and another on qualified opportunities (Salesperson) you will probably have a process like this whenever a Telemarketer decides to convert the Lead to Opportunity:

  1. Assign the Lead to the Salesperson

  2. Send an introductory email FROM the Salesperson to the Lead (click here for the article on how to do that)

  3. Convert the Lead

  4. Notify the Salesperson via email of the new opportunity assigned to them.

On that last step, it would be helpful if the email contained a link that the Salesperson would click to quickly open the Opportunity in CRM.  It's possible to do this with a Workflow rule and a custom workflow assembly.

You can create such a rule in Microsoft CRM 3.0 by following these steps:

  1. Download AM.CrmConstructLink.dll and place it into the "C:\Program Files\Microsoft CRM\Server\bin\assembly" directory.

  2. Stop the Microsoft CRM Workflow Service.  Edit the workflow.config file in the same directory (see very bottom) or if you haven't made any other customizations to it, you can just replace it with this download: workflow.config (our version includes the default entries from MS CRM 3.0 plus all our workflow assembly registrations from this and other articles).  Start the service.

  3. You can now import the rule using the Microsoft CRM Import Workflow Wizard from this file: CRMWorkflow.NotifySalesPersonOfNewOpportunity.xml

  4. Activate the rule in Workflow Manager under Opportunities.

Note that the code in the workflow assembly is based on:
http://blogs.msdn.com/crm/...entity-links-in-email-sent-via-workflow.aspx

The custom workflow assembly is actually rather generic and just constructs a link tag out of provided strings.  However, because of the way the workflow engine works, the assembly has to be individually configured for each entity for which you want to send an email with an embedded link.  The following XML from our workflow.config enables it for Task and Opportunity (the custom actions will show up under Call assembly - Link):

<method name="Construct Link To Entity - Task"
  assembly="AM.CrmConstructLink.dll" typename="AM.ConstructLinkAssembly"
  methodname="ConstructLink" group="Link">
    <parameter name="baseUrl" datatype="string"/>
    <parameter name="objectId" datatype="lookup" entityname="task"/>
    <result datatype="string"/>
</method>
<method name="Construct Link To Entity - Opportunity"
  assembly="AM.CrmConstructLink.dll" typename="AM.ConstructLinkAssembly"
  methodname="ConstructLink" group="Link">
    <parameter name="baseUrl" datatype="string"/>
    <parameter name="objectId" datatype="lookup" entityname="opportunity"/>
    <result datatype="string"/>
</method>

 

Because our assembly dll is unsigned, to use it, you must have the allowunsignedassemblies attribute set in the root node (top-most tag) of this XML file:

<workflow.config xmlns="http://microsoft.com/mscrm/workflow/"
  allowunsignedassemblies="true" >

Finally, our workflow rule is set up to fire whenever an Opportunity is created.  If this is more appropriate, you can set it up to fire whenever one is assigned instead.  In addition, you can modify the rule to place merge data fields into the send email from the Opportunity or Account entities (remember that a rule must be deactivated before it can be modified).

 

© Copyright 1996-2014 by am.net and Solitex Networks. Legal Notices.
Creative Commons License Articles on this site are licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.