Announcement

Collapse
No announcement yet.

leadname is null when lead is a foreign entitny in a many to one relation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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}


    -----------------------------------------------------------------
    1. What errors are logged

      No error where logged
    2. Explicit unambiguous steps for reproducing the issue.
      1. create a new entity
      2. create a many to one relation with Lead
      3. add lead field to list and detail view of the new entity
      4. create a lead with empy name field (just the account name)
      5. 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)
      6. display the new entity list: the lead field show the id of the lead (instead of the account name)
      7. display the details of the entity you just created: the lead field show the id of the lead (instead of the account name)
    3. EspoCRM version number.

      8.2.2
    4. PHP version number.

      8.2
    5. Database platform name (MySQL, MariaDB, PostgreSQL) and version number.

      PostgreSQL 16.1
    I was able to reproduce the issue also on demo.eu.espocrm.com.

  • #2
    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...rclassnamelist

    Comment


    • #3
      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).

      Comment

      Working...
      X