locked
CRM 2011-Set Owner in Case to "From" address in Email? RRS feed

  • Question

  • I currently have a workflow that creates a case based on an email that is sent to a queue.  That is working just fine.  But I cannot figure out a way to set the Owner field to the person who sent the email to the queue.  It will not allow you set the Owner based on the "From" address.  Is there a way to set the Owner to the person who sent the email?

    Tuesday, September 25, 2012 4:24 PM

All replies

  • I suspect this isn't going to be possible without creating a custom workflow activity - as the email sender might not necessarily be a CRM user and thus not resolve back to a record that is valid to own the case. 

    Jason Lattimer

    Tuesday, September 25, 2012 4:49 PM
    Moderator
  • The email sender will always be a valid user because the TO email address is specifically for creating a case.  Only internal people will have it and use it.  They all have their email address associated with their user in CRM.  Also I already have the workflow requiring that the TO address be the specific one and the FROM address has to be one of the 5 email addresses in order to even create a case.

    Tuesday, September 25, 2012 5:53 PM
  • We have just done a similar solution for a customer.. and it did require a plugin to fullfill the customers request.

    You are unable to retrieve the "From address" because this is a special field that is not "supported" in workflow usage.

    What you need to do is create a plugin that runs on creation of the email that creates the case for you and then sets the owner. There is no other way.

    You will want to do this through a plugin... the reason is that if you try and accomplish this through a workflow, you are unable to update the email on case creation with a "regarding value" as the email is set to status recived which is a closed status. Alternately you will need to create a workflow assemble which in turn is just as complicated as just writing a plugin that creates the case.

    It took us aproximately 4 hours to create the plugin.


    Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com

    Tuesday, September 25, 2012 9:08 PM
  • We have just done a similar solution for a customer.. and it did require a plugin to fullfill the customers request.

    You are unable to retrieve the "From address" because this is a special field that is not "supported" in workflow usage.

    What you need to do is create a plugin that runs on creation of the email that creates the case for you and then sets the owner. There is no other way.

    You will want to do this through a plugin... the reason is that if you try and accomplish this through a workflow, you are unable to update the email on case creation with a "regarding value" as the email is set to status recived which is a closed status. Alternately you will need to create a workflow assemble which in turn is just as complicated as just writing a plugin that creates the case.

    It took us aproximately 4 hours to create the plugin.


    Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com

    Hi RuneDaub/Akd123,

    Even thought plug in will resolve this issue, I will recommed doing this using custom workflow based on following reasons..

    1. if you do this in plug in this code will get fired for all emails not just for the ones sent to this queue, I guess requirement will be if email is send to queue then and then owner needs to change otherwise not. if we do this as custom workflow then with existing workflow which creates case to have extract step to call this workflow to get the case owner and use that.

    2. even though email or case is closed, owner can be changed using assign API of CRM so with our standard workflow editor we just just step called Assign and then select the new user we got from our custom workflow..

    Now about custom workflow it self let's we call it "RetriveOwnerFromEmail" and inpur perameter for this custom workflow will be email id..

    in custom workflow we will retrieve Email record and then retrive From field [which is party list] find our user from that field and then return the user back as output peramater of custom workflow..

    so this custom workflow will return owner which will be used as explain in step 1 and 2.

    hope this helps..


    MayankP
    My Blog
    Follow Me on Twitter

    Wednesday, September 26, 2012 3:04 PM
    Answerer
  • We have just done a similar solution for a customer.. and it did require a plugin to fullfill the customers request.

    You are unable to retrieve the "From address" because this is a special field that is not "supported" in workflow usage.

    What you need to do is create a plugin that runs on creation of the email that creates the case for you and then sets the owner. There is no other way.

    You will want to do this through a plugin... the reason is that if you try and accomplish this through a workflow, you are unable to update the email on case creation with a "regarding value" as the email is set to status recived which is a closed status. Alternately you will need to create a workflow assemble which in turn is just as complicated as just writing a plugin that creates the case.

    It took us aproximately 4 hours to create the plugin.


    Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com

    Hi RuneDaub/Akd123,

    Even thought plug in will resolve this issue, I will recommed doing this using custom workflow based on following reasons..

    1. if you do this in plug in this code will get fired for all emails not just for the ones sent to this queue, I guess requirement will be if email is send to queue then and then owner needs to change otherwise not. if we do this as custom workflow then with existing workflow which creates case to have extract step to call this workflow to get the case owner and use that.

    2. even though email or case is closed, owner can be changed using assign API of CRM so with our standard workflow editor we just just step called Assign and then select the new user we got from our custom workflow..

    Now about custom workflow it self let's we call it "RetriveOwnerFromEmail" and inpur perameter for this custom workflow will be email id..

    in custom workflow we will retrieve Email record and then retrive From field [which is party list] find our user from that field and then return the user back as output peramater of custom workflow..

    so this custom workflow will return owner which will be used as explain in step 1 and 2.

    hope this helps..


    MayankP
    My Blog
    Follow Me on Twitter


    I like this answer. However, I just found out yesterday that you cannot do a custom workflow with the Hosted Solution. I did not know that. What I'm thinking about doing now is having a hidden field that collects the "From" information and then using javascript to check that field and set the lookup based on the contents of the field. I will have to hard to hard code the ownerid in there, but it's only for five people. I'm having fun trying to figure out exactly how to set a look up value in javascript.
    Wednesday, September 26, 2012 3:41 PM
  • Opps, sorry did not know you are on a hosted system. is it CRM 4.o or CRM 2011?

    if this CRM 2011 you can still do work around as mentioned in article below..

    http://blog.avtex.com/2011/03/04/a-workaround-for-custom-workflows-in-crm-online-2011-part-i/

    your javascript solution will work but for that user needs to open email or case, if they do not open email form then your java script will not run. setting up look value in java script should be really easy as shown in  article below..

    http://bingsoft.wordpress.com/2010/04/21/set-lookup-value-using-javascript-tip/


    MayankP
    My Blog
    Follow Me on Twitter

    Wednesday, September 26, 2012 3:53 PM
    Answerer