It worked, but like this:
$i = 0;
$accountEmailAddresses = list();
while ($i < array\length(account.emailAddressData)) {
$accountEmailAddressesItem = array\at(account.emailAddressData, $i);
$accountEmailAddresses = array\push(
$accountEmailAddresses,
object\get($accountEmailAddressesItem, 'emailAddress')
);
$i = $i + 1;
}
cAccountEmail = array\join($accountEmailAddresses, ', ');
Opportunities - Account
Collapse
X
-
Principal identical:
I use cAccountEmail field. In your case it may be different.Code:$i = 0; $accountEmailAdresses = list(); while ($i < array\length(account.emailAddressData)) { $accountEmailAdresseItem = array\at(account.emailAddressData, $i); $accountEmailAdresses = array\push( $accountEmailAdresses, object\get($accountEmailAdresseItem, 'emailAddress') ); $i = $i + 1; } cAccountEmail = array\join($accountEmailAdresses, ', ');
I advice you to reed documentation on the formula used in EspoCRM: https://docs.espocrm.com/administration/formula/.Last edited by victor; 06-02-2026, 02:30 PM.Leave a comment:
-
Can I use another formula bellow this one? I need to do the same for the emails. Where can I get the variables?
ThanksLeave a comment:
-
In Administration > Entity Manager > Opportunity > Formula > Before Save Custom Script:
Code:$i = 0; $accountPhoneNumbers = list(); while ($i < array\length(account.phoneNumberData)) { $accountPhoneNumbersItem = array\at(account.phoneNumberData, $i); $accountPhoneNumbers = array\push( $accountPhoneNumbers, object\get($accountPhoneNumbersItem, 'phoneNumber') ); $i = $i + 1; } cAccountPhone = array\join($accountPhoneNumbers, ', ');Leave a comment:
-
If I have 3 phone numbers it only gets the first one. Is there a way to get all the phone numbers?Leave a comment:
-
I just refresh the browser and the Recalculate Formula appeared
thanksLeave a comment:
-
I don't have The option Recalculate Formula .
But it worked. Thanks
Leave a comment:
-
Yes, it is possible. Here is an example for the phone field. For the rest, the principle is the same:
1. In Administration > Entity Manager > Opportunity > Fields create Account Phone field (most likely, this field will be created with the prefix "c", as in screenshot 1).
2. In Administration > Entity Manager > Opportunity > Formula > Before Save Custom Script, create a formula like this:
3. For new Opportunities it will work instantly, but for old ones you need to do the Recalculate Formula function.Code:cAccountPhone = account.phoneNumber;
Leave a comment:
-
Can we create a text field and get that information into it with a formula from the Account?
Maybe it's easier ?Leave a comment:
-
Please show in screenshot where you want more data about the relayed account. If you mean that your Account name should display your phone number and email address, that won't work.
You can create your own fields in Opportunity and use a formula to get the values from the Account.Last edited by victor; 06-01-2026, 03:35 PM. -
Maybe below the Account, Need to add more fields that would be auto-filled. Or any other idea?
Leave a comment:
-
Opportunities - Account
In Opportunities - Account, when I choose the account how can I also get, not only the account name but also the mobile and office phone and the email?Tags: None

Leave a comment: