<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Creating a calculated field using Email of a related Record</title><link>https://sugarclub.sugarcrm.com/explore/help-forums/enterprise-professional/f/enterprise-professional-questions/2802/creating-a-calculated-field-using-email-of-a-related-record</link><description>In studio, when creating a calculated field for a related record, I&amp;#39;m not able to select Email. Here&amp;#39;s the formula I&amp;#39;m using: related($atc_clientsalesreps_atc_appointments,&amp;quot;email&amp;quot;) After saving that formula and Mass Updating both the parent record and</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Creating a calculated field using Email of a related Record</title><link>https://sugarclub.sugarcrm.com/thread/14919?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2019 17:08:09 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:2c06f627-0a84-42a0-9756-4269d39a8828</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;I would&amp;nbsp;caution against&amp;nbsp;using email1 since it has been deprecated and will be removed:&lt;/p&gt;&lt;p&gt;&amp;quot;&lt;span style="color:#000000;background-color:#ffffff;"&gt;We observe many examples of custom code (and some core code) that still use the old&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong style="color:#000000;background-color:#ffffff;border:0px;font-weight:bold;"&gt;email#&lt;/strong&gt;&lt;span style="color:#000000;background-color:#ffffff;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;fields. This is probably because it is convenient to use the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong style="color:#000000;background-color:#ffffff;border:0px;font-weight:bold;"&gt;email1&lt;/strong&gt;&lt;span style="color:#000000;background-color:#ffffff;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;field like a regular text field.&lt;/span&gt;&lt;strong style="color:#000000;background-color:#ffffff;border:0px;font-weight:bold;"&gt;But this is out of date, inaccurate, deprecated, and subject to removal in upcoming Sugar releases.&amp;quot;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style="color:#000000;background-color:#ffffff;border:0px;font-weight:bold;"&gt;&lt;a href="https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/using-e-mail-fields-correctly-in-sugar"&gt;https://community.sugarcrm.com/community/developer/blog/2017/08/01/using-e-mail-fields-correctly-in-sugar&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating a calculated field using Email of a related Record</title><link>https://sugarclub.sugarcrm.com/thread/14918?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 22:18:13 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:8128e714-4921-47fa-a1ad-41bcf6459f3b</guid><dc:creator>Sergio Najera</dc:creator><description>&lt;p&gt;Hello Alex,&lt;/p&gt;&lt;p&gt;You are getting the &amp;quot;Array&amp;quot; response because emails are usually stored in an Array. You are calling the Array, not the elements. What you need to do is select the email element from the Array and display it in your field. Please see the image below.&lt;/p&gt;&lt;p&gt;&lt;a href="/cfs-file/__key/CommunityServer-Components-MultipleUploadFileManager/93452deb_2D00_85c6_2D00_4e08_2D00_a377_2D00_10322323be3e-3525-complete/_5F00_pastedImage_5F00_3.png"&gt;&lt;img src="/cfs-file/__key/CommunityServer-Components-MultipleUploadFileManager/93452deb_2D00_85c6_2D00_4e08_2D00_a377_2D00_10322323be3e-3525-complete/_5F00_pastedImage_5F00_3.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Your formula is:&amp;nbsp;related($atc_clientsalesreps_atc_appointments,&amp;quot;email&amp;quot;)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The new formula is:&amp;nbsp;related($atc_clientsalesreps_atc_appointments,&amp;quot;email1&amp;quot;)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Please notice that I write &amp;quot;email1&amp;quot; instead of &amp;quot;email&amp;quot;. This way you are able to select the first element of the Array.&lt;/p&gt;&lt;p&gt;In order to implement this approach, you need to have a relationship between these two modules.&lt;/p&gt;&lt;p&gt;Sergio N.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating a calculated field using Email of a related Record</title><link>https://sugarclub.sugarcrm.com/thread/14917?ContentTypeID=1</link><pubDate>Tue, 15 Jan 2019 21:58:14 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:d94737f2-a5bc-40c1-a0ea-ffc8a4f1c5b9</guid><dc:creator>Angel Martinez</dc:creator><description>&lt;p&gt;Hello &lt;a href="https://sugarclub.sugarcrm.com/members/alex.wilder"&gt;Alex Wilder&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I was able to get the email from a related record following these steps:&lt;/p&gt;&lt;p&gt;Module A: Source record.&lt;/p&gt;&lt;p&gt;Module B: Target record.&lt;/p&gt;&lt;p&gt;Create a calculated text field in module A, let&amp;#39;s name it &lt;strong&gt;module_a_email_c&lt;/strong&gt; and set this formula in:&lt;/p&gt;&lt;p&gt;related($email_addresses,&amp;quot;email_address&amp;quot;)&lt;/p&gt;&lt;p&gt;Create a calculated text field in module B, let&amp;#39;s name it &lt;strong&gt;email_from_a_c&lt;/strong&gt; and set this formula in:&lt;/p&gt;&lt;p&gt;related($module_a,&amp;quot;&lt;strong&gt;module_a_email_c&lt;/strong&gt;&amp;quot;)&lt;/p&gt;&lt;p&gt;Keep in mind that there should be an actual relationship between these two modules.&amp;nbsp;&lt;/p&gt;&lt;p&gt;I hope this helps.&lt;/p&gt;&lt;p&gt;Regards,&amp;nbsp;&lt;/p&gt;&lt;p&gt;Angel M.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating a calculated field using Email of a related Record</title><link>https://sugarclub.sugarcrm.com/thread/14916?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 18:30:02 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:e6523504-d69f-4f5f-8018-2b9919ba1dd8</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;I think email retrieved is&amp;nbsp;something like:&lt;/p&gt;&lt;pre class="language-none line-numbers"&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;quot;email&amp;quot;:[&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;{"email_address":"me@my.crm"&lt;br&gt;,"primary_address":"1"&lt;br&gt;,"invalid_email":"0"&lt;br&gt;,"opt_out":"0" }]&lt;span class="line-numbers-rows"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You could try using email1, though I seem to recall reading somewhere that it is going away.&lt;/p&gt;&lt;p&gt;Is your heart set on using Sugar Logic? You could use a before save to retrieve the email address and populate the field or, depending on your scenario, use the controller to fetch and populate the email address in your field before the user saves the record.&lt;/p&gt;&lt;p&gt;HTH&lt;/p&gt;&lt;p&gt;Francesca&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>