Tuesday, January 15, 2019

After Converting a Lead the Lead Source of the Contact Created is Blank

Details of the scenario based on Release Notes 2013.1:

"Prior to Version 2013 Release 1, you could only track lead source for customers. Now, you can track the lead source for contacts, helping you know which marketing campaigns bring contacts to your company. The lead source for a contact can be different than the lead source for the customer it is associated with. If you create online customer forms that allow you to capture contact information, there is a new option on the Set Up Workflow subtab of the online form record."

1. Log in as Administrator.
2. Go to List > Relationship > Leads.
3. Edit any Lead record.
4. Set Lead record as an "Individual" type.
5. At the Marketing Tab of the Lead, set value to the Lead Source field.
6. Click Save and Convert.
7. Refer back to the Lead record and you will notice that a Prospect Record and Contact Record have been created.
8. View contact record.
9. At the Contact Record, go to Marketing tab .
10. The Lead Source field is still blank.

We may deploy a user event script to source the Lead Source of Lead/Prospect/Customer to the Contact Lead Source field:

function beforeSubmit(type){

                // Get company ID. This will return company's internal id.

var parent_company= nlapiGetFieldValue('company');
               

// Check if there is already a company source to reference the lead source.

                if(parent_company!= "" || parent_company!= null){

                                // Create a variable that will hold prospect's / company's lead source value.

                                var leadsource_value = nlapiLookupField('prospect', parent_company, 'leadsource');

                                // Set Lead Source value in the Contact.

                                nlapiSetFieldValue('contactsource',leadsource_value);

                }

}

 

Parameter Definitions:

Leadsource – internal id of Lead Source in Prospect record
contactsource – internal id of Lead Source in Contact record

No comments:

Post a Comment