In Account module, I have a field called Client ID, so when i am creating a new record with the same phone number of the existing Account. I want to fetch the Client ID from the existing Account to this new record. How can i achieve this?
Announcement
Collapse
No announcement yet.
Fetching existing Number (auto-increment) field value from one record to another
Collapse
X
-
Playing with phone number can be difficult but it sound achievable with formula and find(record). Here is a small sample I use to auto assign my email Parent field to a Case.
I link it by doing a search for the email reference.
Code:$findrecord = record\findOne('Case', 'field_searchbyID', 'desc', 'field_searchbyID=', string\substring(subject, 0, 5)); // 'desc' is Descending, must have this field. Case is the entity, substring is what I'm trying to find, I see in the field subject, and I want the 5 digits. (writing these comment on top of my head, so consult the formula documentation: https://docs.espocrm.com/administration/formula/) ifThen( entity\isNew = true && fromAddress == 'email1@email.com' && $findrecord != null, //emailCategory = list($findrecord, parentType, 'Case', parentId = $findrecord); parentType = 'Case'; parentId = $findrecord );
Comment
-
esforim Can you please help me out on this issue,
Comment
Comment