Thanks. I will give it a try.
As a workaround I'm currently using a foreign field, but I do not like the added clutter.
btw a children-to-parent relation does not have the same problem (but, again, it adds unneeded clutter).
leadname is null when lead is a foreign entitny in a many to one relation
Collapse
X
-
It's how it always been working I believe. There's is no simple solution unfortunately. As a workaround, you can write a loader that will load the lead name. https://docs.espocrm.com/development...rclassnamelistLeave a comment:
-
leadname is null when lead is a foreign entitny in a many to one relation
when i create a relation many to one with Leads, leadname is null if Name in the selected Lead is empty (it does not use the ->getName method, i.e. using Name if available, or AccountName, or Telephone, etc.). leadId is shown instead.
See attached pictures, where api response for the related entity was:
{"id":"ce41c0e8593f462f9","name":"UNITA' SECONDARIA - UNITA SECONDARIA","deleted":false,"description":null,"cr eatedAt":"2024-03-26 23:16:56","modifiedAt":"2024-04-09 16:02:05","addressStreet":"Via xxx, 6","addressCity":"xxxx","addressState":"xxx","addr essCountry":"Italy","addressPostalCode":"30029","c reatedById":"system","createdByName":"System","mod ifiedById":"65f2e6c16564600c6","modifiedByName":"A dmin","assignedUserId":null,"assignedUserName":nul l,"teamsIds":[],"teamsNames":{},"accountId":null,"accountName":nu ll,"leadId":"761f2ccd7d384efea","leadName":null}
------------------------------------------------------------------ What errors are logged
No error where logged - Explicit unambiguous steps for reproducing the issue.
- create a new entity
- create a many to one relation with Lead
- add lead field to list and detail view of the new entity
- create a lead with empy name field (just the account name)
- create a new entity and select the a.m. lead
(the created entity show the lead field with the correct value, i.e. the account name) - display the new entity list: the lead field show the id of the lead (instead of the account name)
- display the details of the entity you just created: the lead field show the id of the lead (instead of the account name)
- EspoCRM version number.
8.2.2 - PHP version number.
8.2 - Database platform name (MySQL, MariaDB, PostgreSQL) and version number.
PostgreSQL 16.1
2 PhotosTags: None - What errors are logged

Leave a comment: