Convert Lead to new entity type Person

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1476

    Convert Lead to new entity type Person

    Hi,
    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.


    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #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

    Cheers
    Rabii
    Web Dev

    Comment

    • item
      Active Community Member
      • Mar 2017
      • 1476

      #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

      Thanks

      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.
      If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #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.
        Rabii
        Web Dev

        Comment

        • item
          Active Community Member
          • Mar 2017
          • 1476

          #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 ?
          If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

          Comment


          • 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.
        Working...