locked
Sending emails on phone call completion through workflow RRS feed

  • Question

  • Hi all
    I'm having problems solving what I thought would be a very simple task for at customer. Here is what I want:
    - I'm creating phone call activities on contacts using the quick campaign feature
    - After the completion of each phone call I want to send an email to the contact with some additional information using af workflow
    - The additional information could for example be the contacts address

    Here is where it gets tricky. Since the regarding field on the phone call activity is related to the quick campaign and not the contact I'm unable to get additional information from the contact entity in my e-mail workflow. The only attribute I have access to is the contact name which I get through the recipient field. It's somewhat frustrating that even though the contact entity is obviously related to the phone call I can't fetch data from it in the workflow.
    Can anyone help me out.

    Thanks!
    Thomas
    Kind regards, Thomas Rath
    Tuesday, October 20, 2009 9:16 AM

Answers

  • Succes!!!
    It works after having added the lookup to contact on the phone call entity and the jscript onLoad.

    Here is the code. Be aware that I have renamed the contact entity to "medlem" so in a standard setup you would have to do a little search and replace on "medlem" to get it to work. We hide the lookup on the phone call form but that is off course optional.

    -----
    crmForm.all.org_medlemid_c.style.visibility = 'hidden';
    crmForm.all.org_medlemid_c.style.display = 'none';

    crmForm.all.org_medlemid_d.style.visibility = 'hidden';
    crmForm.all.org_medlemid_d.style.display = 'none';


    if (crmForm.all.org_medlemid.DataValue == null)
    {
       if (crmForm.all.to.DataValue != null && crmForm.all.to.DataValue.length > 0)
       {
          if (crmForm.all.to.DataValue[0].typename == "contact")
          {
             var lookupData = new Array();
             var lookupItem= new Object();

             lookupItem.id = crmForm.all.to.DataValue[0].id;
             lookupItem.typename = 'contact';
             lookupItem.name = crmForm.all.to.DataValue[0].name;

             lookupData[0] = lookupItem;

             crmForm.all.org_medlemid.DataValue = lookupData;
             crmForm.Save();
          }
       }
    }

    With the reference to the contact entity it is now possible to get additional data from the contact and use that in my email workflow.
    Hope this helps others that might have similar problems.
    Regards


    Kind regards, Thomas Rath
    • Marked as answer by ThomasRath Tuesday, October 20, 2009 11:13 AM
    Tuesday, October 20, 2009 11:13 AM

All replies

  • Hi Thomas

    Would this help -

    - Instead of marking the Phone call as "Made", can you also do an additional step of "Promote to Response" and select the "Response Code" as Interested.
    - Run your workflow on Campaign response created.
    - Use the Customer field on Campaign response to send the email

    Regards
    Pawan
    Tuesday, October 20, 2009 10:15 AM
  • Hi Pawan
    That might work. But I would prefer not to add an additional step of creating responses. 

    I actually think we came up with a solution that will work.

    The solution is to add a lookup to contact on the phone call entity. We then add a little jscript onLoad on the phone call form that fetches the contact from the recipient field and adds the reference in the contact lookup attribute. This way I can go thought that lookup in my workflow and fetch additional contact information. The downside is that this will only work if you have one receipient on the phone call. But in my scenario that's not a problem.

    We are currently working on it. I'll post an update once we get it to work.


    Kind regards, Thomas Rath
    Tuesday, October 20, 2009 10:30 AM
  • Succes!!!
    It works after having added the lookup to contact on the phone call entity and the jscript onLoad.

    Here is the code. Be aware that I have renamed the contact entity to "medlem" so in a standard setup you would have to do a little search and replace on "medlem" to get it to work. We hide the lookup on the phone call form but that is off course optional.

    -----
    crmForm.all.org_medlemid_c.style.visibility = 'hidden';
    crmForm.all.org_medlemid_c.style.display = 'none';

    crmForm.all.org_medlemid_d.style.visibility = 'hidden';
    crmForm.all.org_medlemid_d.style.display = 'none';


    if (crmForm.all.org_medlemid.DataValue == null)
    {
       if (crmForm.all.to.DataValue != null && crmForm.all.to.DataValue.length > 0)
       {
          if (crmForm.all.to.DataValue[0].typename == "contact")
          {
             var lookupData = new Array();
             var lookupItem= new Object();

             lookupItem.id = crmForm.all.to.DataValue[0].id;
             lookupItem.typename = 'contact';
             lookupItem.name = crmForm.all.to.DataValue[0].name;

             lookupData[0] = lookupItem;

             crmForm.all.org_medlemid.DataValue = lookupData;
             crmForm.Save();
          }
       }
    }

    With the reference to the contact entity it is now possible to get additional data from the contact and use that in my email workflow.
    Hope this helps others that might have similar problems.
    Regards


    Kind regards, Thomas Rath
    • Marked as answer by ThomasRath Tuesday, October 20, 2009 11:13 AM
    Tuesday, October 20, 2009 11:13 AM