Calculated field to concatenate Email fields

We have a field on the Opportunity module which concatenates the email and email2 field from related contact (it's a custom 1:M contacts_opportunities relationship:

concat(related($contacts_opportunities,"email1"),";",related($contacts_opportunities,"email2"))

After upgrading to Sugar 11, this no longer works. I don't think email2 is accepted anymore. I'm wondering what is another way we can do this? Ideally to concat as many email addresses as possible from the related contact?

Will greatly apppreciate any help. Thank you.

Parents
  • Hi ,

    So the opportunity has one contact and you want all the email addresses for that contact to be listed on the Opportunity as a semi-colon separated list.

    Do you want this to be a snapshot in time when the Opportunity is created or do you want that list to be updated every time you update either the Contact's email addresses or the Opportunity?

    What is the ultimate business purpose for this field?

    I'm asking so I might understand how to best achieve your goal without having to store such a list which may be error prone, I used to do that in a custom module back when I first started working with Sugar in v6 but ran into so many issues that I totally scrapped it and started over with a total redesign to meet our needs.

    FrancescaS

  • So the opportunity has one contact and you want all the email addresses for that contact to be listed on the Opportunity as a semi-colon separated list

    Precisely.

    Do you want this to be a snapshot in time when the Opportunity is created or do you want that list to be updated every time you update either the Contact's email addresses or the Opportunity?

    The latter. We would like it to be updated along with the Contact and kept in sync with it.

    What is the ultimate business purpose for this field?

    To allow sales reps to both easily see as well as copy/paste all of the customer's available email addresses instead of just the primary.

    I'm asking so I might understand how to best achieve your goal without having to store such a list which may be error prone, I used to do that in a custom module back when I first started working with Sugar in v6 but ran into so many issues that I totally scrapped it and started over with a total redesign to meet our needs.

    Of course. :) Thank you so much.

Reply
  • So the opportunity has one contact and you want all the email addresses for that contact to be listed on the Opportunity as a semi-colon separated list

    Precisely.

    Do you want this to be a snapshot in time when the Opportunity is created or do you want that list to be updated every time you update either the Contact's email addresses or the Opportunity?

    The latter. We would like it to be updated along with the Contact and kept in sync with it.

    What is the ultimate business purpose for this field?

    To allow sales reps to both easily see as well as copy/paste all of the customer's available email addresses instead of just the primary.

    I'm asking so I might understand how to best achieve your goal without having to store such a list which may be error prone, I used to do that in a custom module back when I first started working with Sugar in v6 but ran into so many issues that I totally scrapped it and started over with a total redesign to meet our needs.

    Of course. :) Thank you so much.

Children
  • email1 and email2 were deprecated some time ago, but they still exist in v11.0.3 so I think the issue you are seeing may be something else, perhaps their use is no longer allowed in formulas though they are there.

    If you try to edit and save the formula as is, does the system give you an error?

    On mine it complains about the "$contacts_opportunities" not being valid and when I try from scratch, it populates the relationship name as "$contacts" and not "$contacts_opportunities"

    So it won't accept your version but it will accept:

    concat(related($contacts,"email1"),";",related($contacts,"email2"))

    But mine has so many customizations I don't even know what's out of the box anymore...

    All other options I can think of would require code...

    One option would be a before save logic hook on the Opportunity that finds the related Contacts and their email addresses and concatenates the addresses into a text field. However it can get complicated pretty quickly because you would want to trigger the change in multiple cases, at a minimum:

    - when a Contact is added/updated on the Opportunity

    - when an email address on the contact is added or removed or marked invalid or opted out you would need to find all the Opportunities (or at least the open ones) related to that contact and update them to keep the sales rep from using old information...

    it sounds like a bit of a challenge not only to implement but also to maintain.

    I have had some "custom compose" actions on the Emails subpanel to compose emails with a combination of addresses from related contacts/users on the Cases module and I am living to regret it to be honest... the big lesson I learned in the past 12 years of working with Sugar is: "just because you can, doesn't mean you should" and trust me you can do a whole lot if you set your mind to it.... Pick your customizations wisely. Slight smile

    I hope you find a no-code solution for your problem.

    Sorry I could not be more help.