Populate lead value on target conversion

Hi there

I have added a new field on the target entity - 'Website'.

I want to automatically populate this value on the lead when it's converted.

I have tried using a A BPM, but can't work out a way to do it.

Any ideas please?

Many thanks

Ray Brookes

  • If Target Conversion to Leads works similar to Lead Conversion to Opportunities (I haven't tested Target conversion), create a field in the Leads Module making sure it is has exactly the same name as the equivalent field in Targets. It should populate the Leads field on Target Conversion.

  • The problem is that during conversion the copied fields must have exactly the same name in both modules and that the website filed already exists in Leads but not in Propects (Targets).

    So, when you create a new field "website" in Prospects it will be the field name "website_c".

    Different possible solutions exist:

    1. You create a field target_website_c in Propects and Leads and change the Leads website field to a calculated which is filled with tarte_website_c. This does NOT work as the website field has field type URL which is not allowed to be calculated. I did not test whether it works with BPM.

    2. You create new fields target_website_c in all relevant modules (Prospects, Leads, Accounts, perhaps Contacts). That solution is a little bit ugly as you throw away the original website field, but it works without coding.

    3. You create a real field website in the Prospects module which will be copied during conversion from Prospects to leads to Accounts. To do that you must use the extension framework of Sugar and create the field in a small vardef extension which must be added in custom/Extension/modules/Prospects/Ext/Vardefs/. With that file installed you must call Qucik Repair & Rebuild and the field will be offered to be created in the propects database table. When this was done the field website in Prospects behaves like an out-of-the-box field website.

    For solution 3 you need a php file which looks similar to this one e.g. in custom/Extension/modules/Prospects/Ext/Vardefs/sugarfield_website.php:

    <?php 
     $GLOBALS["dictionary"]["Prospect"]["fields"]["website"]=array (
          'name' => 'website',
          'vname' => 'LBL_WEBSITE',
          'type' => 'url',
          'dbType' => 'varchar',
          'len' => 255,
          'link_target' => '_blank',
          'comment' => 'URL of website for the company',
        );
    

    And a language entry e.g. in custom/Extension/modules/Prospects/Ext/Language/en_us.website.php:

    <?php
    $mod_strings['LBL_WEBSITE'] = 'Website';
    

    See here for more documentation about solution 3: 
    https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.2/Data_Framework/Vardefs/Manually_Creating_Custom_Fields/

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH