Skip to main content

How to add a new column to vtiger existing table


When we add a new column to existing vtiger table, we need do more than just adding a column to selected vtiger table. If you do so, you may unable to do some DB operation like insert update and deleted. This is the way how we can do this.

1. Add a new column to selected table as normal
2. Add a new row to "vtiger_field" table as fallow


  
"insert into vtiger_field values (tabid, fieldid, columnname, tablename,
generatedtype, uitype, fieldname,
fieldlabel, readonly, presence, selected,maximumlength, sequence,
block, displaytype, typeofdata, quickcreate,quickcreatesequence, info_type)"


When you set a value to "presence" field be make sure to select 0 or 2. Otherwise your selected field not populated with vtiger field list.

Comments

  1. wow! That's I never realized it.
    But anyway, Wat about if we do creating Field
    from the User Interface.

    Well, go to Settings | Module Manager |
    Custom | Add Block. That's it!
    We add new fields from there.

    Have u ever used this to add new field as unique?

    ReplyDelete
  2. I did that, but when I create/modified a record, the change didn't save the information in the new field...what's wrong?

    ReplyDelete
  3. Hello friends!
    Can you help me please.
    I created field in vtiger_field table with uitype 51. But when i choose value in my module, it does'n save value in vtiger_mymodulename.
    What can i do else?
    I hope you will help me. Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

How to extract vtiger DB data

Here is the code sample how extract data form vtiger DB with WHERE close. Sample:1 require_once('include/DatabaseUtil.php'); global $adb; $tabid = array('9','16'); $sql = "SELECT tabid, fieldname, fieldid, fieldlabel,columnname, tablename, uitype, typeofdata, presence FROM vtiger_field WHERE tabid in (" . generateQuestionMarks($tabid) . ")"; $result = $adb->pquery($sql, array($tabid)); // get result $noofrows = $adb->num_rows($result); // get number of rows $i=0; $data=array(); while($resultrow = $adb->fetch_array($result)) { $tabid=$resultrow['tabid']; $resultrow=['fieldlabel']; $data[$i]=array($tabid, $resultrow); } Sample:2 require_once('include/DatabaseUtil.php'); global $adb; $query = 'select idlists,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid =?'; $result = $adb->pquery($query, array($focus->id)); $from_email = $adb->query_result($result,0,'from_...

Unix VS Linux

Free Software says that people have freedom to share software and related technology free without any hesitating. And also this may enable the rapid software development because all brains become to one stage and play the game. On a technical level, Free software grantees the right view and also modify source code if some one need different think as his view. In this post I am not going to deeply discuss about what Unix is and What Linux but here lats we talk about some interesting happenings around Unix and Linux What is Unix. In 1980, A computer scientist called Richard Stallman decided to create a venerable operating system called Unix. At the time Unix ran many of industrial and academic system in the world. He started developing Unix operating system and most of the world wide people join with him to success this operating system. Stallman called his version as "GNU" (Pronounced G-noo). This was start of GNU but not Unix, any way this was the new legendary of Unix so th...

GIS location selector

Using google maps is the best and easy way to integrate GIS information system to your web sites. Most of the social media application using google maps to their sites in current world. In here we are going to discuss how to integrate google maps in our web site and mark location from given set of locations. Simply here we are going to get location form mysql data base and populate those location on google map. step 01: First we need to obtain a google map API key form google. Click here to get api key. Step 02: Setup data base which included gis locations. in this database have included US locations and its GIS locations. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `gis` -- -- -------------------------------------------------------- -- -- Table structure for table `gis_locationinfor` -- CREATE TABLE IF NOT EXISTS `gis_locationinfor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `region` varchar(100) NOT NULL, `country` varchar(100) NOT NULL, `states` varchar(100) NOT N...