none
Workflow E-mail to specific team

    Question

  • Dear all,

    I have created two teams, TSUN and TMicrosoft.

    In the Subject hierarchy I have added "SSUN" and "SMicrosoft".

    In Campaign entity I have created a N:1 relationship with Subject.

    I am creating a workflow, when a new record for campaign is created and the Subject is SSUN, an email should be sent to the team members of TSUN.

    But when I am craeting the workflow to send mail, how will i be able to add the team member TSUN in the email addresss.

    any idea how i can achieve this??

    Many Thanks



    Thursday, October 01, 2009 10:36 AM

Answers

All replies

  • Hi, Vinay.

    It seems that this can be done only with custom workflow action...
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Thursday, October 01, 2009 10:45 AM
    Moderator
  • Hi, Vinay.

    I've developed this custom workflow action. Check this .
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Thursday, October 01, 2009 11:27 AM
    Moderator
  • Hi Andriy,

    I have gone thro the blog.

    Thanks a lot.

    I have a small question, I have compiled and register it.

    It is appearing on my workflows list.

    But how do i use it to send emails.

    Hmmmm.....i know it's a bit silly question to ask....



    Friday, October 02, 2009 5:27 AM
  • Check screenshots:

    From this till 24. I hope this will help you.

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Friday, October 02, 2009 6:56 AM
    Moderator
  • Hi Andriy,

    A small question.

    How can i add two team in the plugin.

    ThanksReply
    Tuesday, October 06, 2009 9:37 AM
  • Hi.

    You have to create two lookups instead one and rewrite code of custom workflow action.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, October 06, 2009 9:39 AM
    Moderator
  • Hi Andriy,

    I have created two lookups in the custom workflow as below:

      public static DependencyProperty TeamProperty = DependencyProperty.Register("Team", typeof(Lookup), typeof(ExportProductInformationActivity));

            [CrmInput("Team")]
            [CrmReferenceTarget("team")]

          
            public Lookup Team
            {
                get
                {
                    return (Lookup)base.GetValue(TeamProperty);
                }
                set
                {
                    base.SetValue(TeamProperty, value);
                }
            }

            [CrmInput("Team")]
            [CrmReferenceTarget("team")]
            public Lookup Team2
            {
                get
                {
                    return (Lookup)base.GetValue(TeamProperty);
                }
                set
                {
                    base.SetValue(TeamProperty, value);
                }
            }


    While I am registering it, I am getting the following error message:

    Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request.
    Detail: <detail><error>
      <code>0x8004501d</code>
      <description>The parameter name 'Team' of property Team2 already exist, the names must be unique</description>
      <type>Platform</type>
    </error></detail>
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at PluginRegistrationTool.CrmSdk.CrmService.Create(BusinessEntity entity) in e:\crmsdk\sdk\tools\pluginregistration\web references\crmsdk\reference.cs:line 212
       at PluginRegistrationTool.RegistrationHelper.RegisterPluginType(CrmOrganization org, CrmPlugin plugin) in E:\crmsdk\sdk\tools\pluginregistration\RegistrationHelper.cs:line 313
       at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in E:\crmsdk\sdk\tools\pluginregistration\PluginRegistrationForm.cs:line 488


    Any Idea where I am wrong??

    Thanks
    Tuesday, October 06, 2009 10:22 AM
  • Try to use following code:


      public static DependencyProperty TeamProperty = DependencyProperty.Register("Team", typeof(Lookup), typeof(ExportProductInformationActivity));

            [CrmInput("Team")]
            [CrmReferenceTarget("team")]

          
            public Lookup Team
            {
                get
                {
                    return (Lookup)base.GetValue(TeamProperty);
                }
                set
                {
                    base.SetValue(TeamProperty, value);
                }
            }

      public static DependencyProperty Team2Property = DependencyProperty.Register("Team2", typeof(Lookup), typeof(ExportProductInformationActivity));



            [CrmInput("Team2")]
            [CrmReferenceTarget("team")]
            public Lookup Team2
            {
                get
                {
                    return (Lookup)base.GetValue(Team2Property);
                }
                set
                {
                    base.SetValue(Team2Property, value);
                }
            }


    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, October 06, 2009 10:25 AM
    Moderator
  • Hi Andriy,

    I have added the following lines of code:


    public static DependencyProperty Team2Property = DependencyProperty.Register("Team2", typeof(Lookup), typeof(ExportProductInformationActivity));
            
            [CrmInput("Team2")]
            [CrmReferenceTarget("team")]
            public Lookup Team2
            {
                get
                {
                    return (Lookup)base.GetValue(Team2Property);
                }
                set
                {
                    base.SetValue(Team2Property, value);
                }
            }


    the workflow is not being executed, I am getting an error when I am opening to see the status of the workflow.

    any ideas??


    Tuesday, October 06, 2009 11:36 AM
  • Hi, Vinay.

    Try to reset your iis and Asynchronous Service.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, October 06, 2009 11:44 AM
    Moderator
  • Hi Andriy,

    I have reset the iis amd the Asynchronous Service.

    It's working fine now.

    You are a genius.....

    Thanks
    Thursday, October 08, 2009 8:39 AM
  • hi can you provide code for the same in crm 2011..

    Thanks in advance..

    Saturday, March 03, 2012 1:06 PM