External link connection
Collapse
X
-
I tried this formula
-----
capRecord = record\findOne('CAP', 'name=', addressPostalCode);
ifThen(
not(string\isEmpty(capRecord)),
cap = record\attribute(capRecord, 'id')
);
-----
but the log gives me this error
[2025-01-29 18:11:55] CRITICAL: (0) Before-save formula script failed. Could not handle 'order' for 'CAP'. :: .../application/Espo/ORM/QueryComposer/BaseQueryComposer.php(2240) -
Hi tothewine,
Your formula script is incorrect overall. Something like this might work (I'm not sure because I don't know the exact names of your fields and entities):
Code:$capRecordId = record\findOne('CAP', null, null, 'name=', addressPostalCode); if ($capRecordId) { cAPId = $capRecordId }
Comment
-
tothewine,
Please note that this solution will only work if you update the Prospect record or recalculate the formula in List View of Prospect records.
If this does not help, please make the following screenshots:- Administration > Entity Manager > CAP
- Administration > Entity Manager > Prospect > Fields > CAP
- Administration > Entity Manager > Prospect > Fields > Address Postal Code
Comment
-
I tried to use the same formula to connect the Appuntamento entity to the CAP entity, but it doesn't work
// Aggiorna da Prospect
indirizzoStreet = prospect.addressStreet;
indirizzoCity = prospect.addressCity;
indirizzoCountry = prospect.addressCountry;
indirizzoPostalCode = prospect.addressPostalCode;
indirizzoState = prospect.addressState;
// Aggiorna CAP
$capRecordId = record\findOne('CAP', null, null, 'name=', indirizzoPostalCode);
ifThen(
$capRecordId,
capId = $capRecordId
);Comment
Comment