vTiger has a flexibility of creating custom picklist, text, currency… fields, however is lacking an option to create custom lookup/related to/relationship fields. We’ve created a detailed guide to walk you through creating a custom Contact or Organization relationship field.
Note, it will require some knowledge of MySQL database and how to connect to it, but other than that – the steps are fairly simple.
Creating a Custom Field
Open Field Editor. (CRM Settings > Modules > Select the Module > Edit Fields)
Create new Custom Field. Select field type as Integer as it will be storing record id. Length can be set to 10(or more if you are planning to have 10M+ records).
Connecting to the vTiger Database via phpMyAdmin
Easiest way to connect to vTiger Database is via phpMyAdmin. Once connected, open the table vtiger_field and find the new field just you created. The quickest way to find the custom field is to sort the records by fieldid – the most recent will be at the top.
Once you located the record, open the record in the edit view and change the uitype to ’10’. Also, please note/write down the fieldid – it will be necessary in the next step. In this case it’s 766.
Creating the Relationship Between Modules
While at phpMyAdmin, find the table ‘vtiger_fieldmodulesrel‘ and this is where you will establish the linkage. We will be creating additional Organization lookup field for the contact.
Insert a new record into the table:
- fieldid – should be ‘766’, we noted that in the previous step.
- module – current module, on which we created the custom field(the very first step we did)
- relmodule – will be “Accounts” since we are creating a new custom Organization lookup field.
- status – leave blank
- sequence – leave blank
Once the record is saved & inserted into the table – you can now see your new shinny Organization lookup field.
In order to create Contact, Opportunity, Ticket, Lead, Project, Invoice, Project Task, Service, Faq, Product, Quote, Sales Order, Purchase Order or any other custom module – you would follow the same process, but just use different values in ‘module’ field and ‘relmodule’ when creating new record in vtiger_fieldmodulerel table.
If you are having trouble creating the fields or need professionals to take care of it for you – please contact us at support@VTExperts.com or give us a call!