No announcement yet.

Convert Lead to new entity type Person

  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert Lead to new entity type Person

    what is files to change or adapt for have Lead to be converted as a custom entity type Person ?

    I just need a direction for theses files to be changed.

  • #2
    Hey item

    Here is a post i have shared before on how to do it

    Hey guys, question, how do I add / remove entities from the lead "Convert" button on the lead?

    Let me know if you have any questions



    • #3
      Hello Rabii,

      don't work and it's same as Activities (for meeting attendee add custom entity) i have modified this file but not upgrade safe. application/Espo/Modules/Crm/Tools/Activities/Service

      If you look this files : Espo\Modules\Crm\Tools\Lead\ConvertService.

      It's hard coded (Account, Opportunuity, Contact.)

      ohh we can leave without convert to custom entity


      EDIT : i don't know why Yuri have hardcoded entity in some place, but certainly have reason, but just my idea, it's not possible to do something so :
      if (record->has(template::Company )) ...
      else if (record->has(template::Person)) ...
      so we can easy add custom entity every where with metadata (i think with my little skill)
      Last edited by item; 03-20-2024, 08:04 PM.


      • #4
        I have just tested the code i have shared with you and it works fine. I have added a custom entity type Person and added it to the lead convert process and it works.


        • #5
          Haaa :s
          what is working for me with your code :

          - when converting, custom Entity is there
          - when select custom Entity : layout convertDetail is OK
          - when click, no error, sidepanel, a new layout appear with "Converted To" and Account, Contact, Opportuinity but not custom entity.

          And last, there are no record in custom entity..

          Is in your test, you can see the new record in the custom entity ?


          • rabii
            rabii commented
            Editing a comment
            You are right. Record is not saved in DB. Best way is to create your custom LeadService and bind it.