How to create a lookup / relation field in vTiger 7

When creating a fields, following changes are needed in database:

  • vtiger_field table – change typeofdata from the current value whatever it might be to I~O
  • vtiger_field table – change uitype from the current value to 10
  • vtiger_fieldmodulerel table – create a new row containing the original fieldid from the vtiger_field table, module where the data is located, module where the data should be looked up from, leaving the last two columns blank. Example:
    2075, Leads, Accounts, NULL, NULL