Method Community

 

Making a Customer email a hyperlink

Last post 10-07-2014 12:57 PM by Method_Inderdeep. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-07-2014 9:16 AM

    Making a Customer email a hyperlink

    What I would like to do:

    In the Edit Customer screen, I have a tab section called "Subaccounts" that has a grid that shows all subaccounts and associated information (active/inactive, phone number, email, etc.).

    I would like the email field to be a hyperlink that launches a new email. The field is the Email field pulled from the Customer table.

    In digging around, it appears the only way to do this is to use the SQL override for the email field in my grid.

    In the CRM_CustomerList Table, there's a "Contact/Name/Email" field in the grid with the following SQL:

    '<b>' + ISNULL(viewContacts.Name,'') + '</b>' + (CASE WHEN viewContacts.Title IS NULL OR viewContacts.Title='' THEN '' ELSE '<br />' + viewContacts.Title END)  + (CASE WHEN viewContacts.Email IS NULL OR viewContacts.Email='' THEN '' ELSE '<br /><a href=''mailto:' + viewContacts.Email + '''  target=''new''>' + viewContacts.Email + '</a>' END)

    Now, I just want the email portion of this to override that email address I'm pulling from the customer table. I'm assuming I need to do this instead of just making the email a hyperlink that launches a new email whan launched. I tried copying the last part of the SQL above:

    CASE WHEN viewContacts.Email IS NULL OR viewContacts.Email='' THEN '' ELSE '<br /><a href=''mailto:' + viewContacts.Email + '''  target=''new''>' + viewContacts.Email + '</a>' END

    but this does not appear to be correct and the grid didn't generate.

    So, what's the proper/correct way to do this?

    Thanks

  • 10-07-2014 11:17 AM In reply to

    Re: Making a Customer email a hyperlink

    Hello MikeB,

    Here's my answer. You mentioned that in your Tab section "Subaccounts" email field is pulled from Customer Table , but if you look closely at the SQL script it is fetching values from Contacts table (eg :Contact.email), that is the only reason it is not populating any data in your grid. Instead of Customer table if you use Contacts table, you will get the deisred results. I tried this on my account and it is working fine.

    I hope this helps.


    -Inder

  • 10-07-2014 11:54 AM In reply to

    Re: Making a Customer email a hyperlink

    Actually, I forgot to mention:

    I changed the field names from "veiwContact.Email" to "viewCustomer.Email" and the entire page wouldn't generate.

    This is the exact script I used (both with the brackets at the beginning and end, and without them.

    (CASE WHEN viewCustomer.Email IS NULL OR viewCustomer.Email='' THEN '' ELSE '<br /><a href=''mailto:' + viewCustomer.Email + '''  target=''new''>' + viewCustomer.Email + '</a>' END)

    The error I get is "Error generating grid"

    Please help.

    Thanks

  • 10-07-2014 12:57 PM In reply to

    Re: Making a Customer email a hyperlink

    Hello MikeB,

    Please ensure that you pull the email field from the Contacts table, once you do that it will not give you the error. Make sure that it is based on Contacts table. Try it with Conatcts Table and let me know if you get the error. You can also have a look at this previous Forum Post, which explains how you can add hyperlink through action result.


    -Inder

Page 1 of 1 (4 items)