4

I have sugarCRM 6.5.20 OnDemand. I am in the Studio. I have a 1:1 relationship from Leads to Leads. I am trying to get the Primary Email address of the related Lead and display it in a calculated field.

It seems like the calculated field formula should look like:

related($emails,"email1")

When I do that I get the following error:

Invalid formula: related: Unknown Field : email1

The dropdown list doesn't list the email at all. How can I get the email? All of my web searches have proven ineffective.

Update:

I am willing to make the calculated field be the primary email address of the current lead. To do that I found 2 variables named $email_addresses and $email_addresses_primary and $emails. There is also a function called valueAt.

I tried to use valueAt(1,$emails) and valueAt(1,$email_addresses)

The validator accepted the syntax but the value was always empty.

Can I make a calculated field off of the leads primary email?

user35201
  • 98
  • 6

1 Answers1

5

You won't get the Email field for the Studio's formula calculation. Email field is stored in a separate table and not in the module's table. It is just put in the Layout along with the other fields of the module, but it is not the same as other fields. All the Email Addresses irrespective of the modules are stored together in the email_addresses table and are related to respective module records in the email_addr_bean_rel.

Venkata Krishna
  • 1,768
  • 2
  • 14
  • 21
  • please read below the update heading in my question. I edited it based off of the information you gave me about the email_addresses table. Does my new approach seem possible? what am I doing wrong? – user35201 Mar 23 '15 at 18:49