Announcement

Collapse
No announcement yet.

Convert Lead to Custom Entity

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

  • Convert Lead to Custom Entity

    Hi.

    Im trying to setup a way to Convert a Lead to Custom Entity using the Convert button feature.
    I get as far as getting the Clients entity to show up on the list to convert to but when I hit convert the record does not post to the Clients entity. (see image below)

    Can you help me figure out what is missing?

    So far I have done the following.

    I added the following to custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json
    Code:
    "convertEntityList": [
            "Account",
            "Contact",
            "Opportunity",
            "Clients"
        ],
        "convertFields": {
            "Contact": [],
            "Account": {
                "name": "accountName",
                "billingAddressStreet": "addressStreet",
                "billingAddressCity": "addressCity",
                "billingAddressState": "addressState",
                "billingAddressPostalCode": "addressPostalCode",
                "billingAddressCountry": "addressCountry"
            },
            "Opportunity": {
                "amount": "opportunityAmount",
                "leadSource": "source"
            },
            "Clients": {
                "name": "name"
            }
        },
    Then I added a detailConvert.json file to custom/Espo/Custom/Resources/layouts/Clients/detailConvert.json

    Code:
    [
        {
            "label": "Overview",
            "rows": [
                [
                    {
                        "name": "firstName"
                    },
                    {
                        "name": "lastName"
                    },
                    {
                        "name": "outcome"
                    }
                ],
                [
                    {
                        "name": "emailAddress"
                    },
                    {
                        "name": "phoneNumber"
                    }
                ],
                [
                    {
                        "name": "address"
                    },
                    false
                ]
            ]
        }
    ]
    Click image for larger version

Name:	Screen Shot 2017-04-27 at 10.47.02 AM.png
Views:	1335
Size:	89.2 KB
ID:	27845

  • #2
    Hello
    convertEntityList is used for removing unnecessary entities from converting. Adding new one is not supported if you can, you may override convert method in Lead Service or use workflow with rule - Lead status is changed and equals Converted, Action - Create Entity Client

    Comment

    Working...
    X