Field mapping in Vtigercrm5.1.0+

Vtigercrm5.1.0+

It is really simple to map fields in Vtiger, the only thing one should remember is to take a bit of precaution while creating a custom field if your don’t want to go to the back office and figure out what those fields are underneath the hood, even that can be done; but the only problem is that if you are new to vtiger, it is quite difficult.  Consider handling more than five hundred tables at first glance and also messing up with one single field can corrupt and things.

Well let us have a look over the admin interface of Vtigercrm and try and create custom fields and map leads to accounts, contacts and potentials if you are using vtigerCRM 5.1.0+.

Using Admin Interface: (Safe and Easy, if you are not lazy :P )

Step 1:  Creating a custom field in leads.

Vtiger Custom Fields

This is a most crucial step if you wish to keep it short and simple.
To create a custom field in leads move to:

Settings>Module Manager > Leads > Layout Editor.

Add Custom Field Vtiger

As you reach here you have various options to create a block or custom field and arrange to specific block you wish to place it.
Note: When you create a field and subsequently  it has to be mapped to accounts, contacts and potentials then you need remember and take careful notes of field name, field type, etc. Because getting this information in later stages is quite difficult.

Vtiger Layout Editor

Step 2:  Creating exact same custom field in Contacts/Accounts.

This is same step as before:
Settings>Module Manager > Contacts/Accounts > Layout Editor.
Again create a custom field with same name, data type and length.

Step 3: Field mapping for leads.

This step gives us the option to map the lead field to any other field of exact same data type.
To can reach to custom mapping module move as follows:

Settings>Module Manager > Leads > Leads CustomField Mapping

Custom Field Mapping Vtiger

Select the field in accounts/contacts/potentials in same row as field in leads and hit SAVE.

This was the simple way when everything is being taken care from the start but what if you have already made many fields in leads and you wish to map it to accounts/contacts and have completely ignored the NOTE in Step 1
Well for it there is a trick but you need to enter inside the hood i.e. the database.

Note: Take the backup of the database first before doing anything (I am sure you won’t like to skip this note :P ).

Using Database: (Fast and Smart, if we are keeping the risk apart ;) )


Well I have explained here in reference with MySQL but it can be done in similar way even if you are using any other database. Tables that will be useful in understanding what I am up to.

1) vtiger_fields: This is the table which contains all vtiger custom and default fields of all the modules. For more details about the table please follow the given link.
http://wiki.vtiger.com/index.php/Creating_New_Fields_in_Existing_Modules
You can have a look over the table structure that will give you the type and length of the field you with to map with other field in any other module.
a) fieldlable: Using which you can edit or search the name of your custom field.
b) fieldid: Gives you the id of the custom field you are looking to map.
c) infotype: ‘BAS’ field is displayed in Basic Information, ‘ADV’ field is displayed in More information.

Where to go:

Data base Vtiger

Explanation of fields:

Explanation of fields

2) vtiger_convertleadmapping: This table consist of the custom field mapping id (as cfmid) and the leadfid, accountfid, contactfid and potentialfid which are filled in as per the mapping we have created.

Vtiger: The MAPPING

Mapping Vtiger

Yes it’s that simple! Only if you know what to change, only these 2 tables are required from here. We can also create new fields and even add new modules to mapping if you are quite good with SQL.

NOTE: If you wish to change the field label of the already created custom field from database then first change the label of field made for LEADS and run query. Then do the same  for ACCOUNTS / CONTACTS / POTENTIALS this will help in retaining the mapping.

Ravish
(Web Developer) E-NOVA Technologies



Related Posts:

Tags: , , ,

Leave a Reply

CommentLuv Enabled

Notify me of followup comments via e-mail. You can also subscribe without commenting.