07-22-2010 05:16 AM
we are trying to import some leads and we need some additional fields.
We added the fields in the database. Within the "Import leads" form the new fields will not be displayed. OK, so we had a look at the "SLX Leads Mapping" Script, added the new fields there and so we can arrange the mapping in the form.
BUT: even if we mapped the new fields they won't be imported.
Does anyone know whats the problem? Did we miss anything?
08-26-2010 06:02 PM
I successfully completed this task today. Here are the notes that I wrote:
In plugin Import Leads:
- look for "Dim arrLeadValues(x)" where x is a number that should be increased by the number of custom fields you are adding.
- define new constants for each custom field using the next index numbers in sequence:
Const IDX_LEAD_CUSTOM1 = 59
Const IDX_LEAD_CUSTOM2 = 60
- for each custom field, add a case stement to sub PopulateArrays( ) of the form
LeadValues(IDX_LEAD_CUSTOM#) = Mid(Value, 1, X) 'Replace X with the max size of the database field
or for booleans
strBool = "F" 'Default value
If (value="T") Then
strBool = "T"
LeadValues(IDX_LEAD_CUSTOM#) = strBool
- For each custom field, add a row to sub InsertRecords( ) of the form:
LeadParameters(IDX_LEAD_CUSTOM#).Value = LeadValues(IDX_LEAD_CUSTOM#)
- Look for objLeadCommand.CommandText and modify the string to add the names of your custom fields to the end of the SQL column list, and then add an equal number of question marks ('?') to the parameter list.
In plugin SLX Lead Mappings:
- in Class_Initialize, add new rows of the form:
AddRecord "DB_FIELD_NAME", cLead, True, False
- in sub LoadFromLeadImportMap, increase the SLX_LEAD_FIELDS_COUNT constant by the number of fields you are adding. I believe that this will cause an error message to be generated if you open an old import map because it will not have the correct number of nodes. This could probably be fixed without too much trouble by editing the XML of the saved import map.
I only tested these steps with custom boolean fields, but I think it should work fine for regular text fields also.