Hi,<div><br></div><div>I'm trying to create a new entity module (ZipCode) where I plan to store all zipcodes from my country.</div><div><br></div><div>If I don't have the database debugging enabled, I receive OK message.</div>
<div><br></div><div>When I enable database debugging, I receive this error message:</div><div><br></div><div>1048: Column 'cvid' cannot be null<br>
<pre align="left"> <font face="Courier New,Courier">ADOConnection._Execute(INSERT INTO vtiger_cvcolumnlist(cvid,columnindex,columnname) VALUES(NULL,0,'vtiger_zipcode:zipcodename:zipcodename:ZipCode_LBL_Z...)</font><font color="#808080" size="-1"> % line 842, file: <a href="file://var/www/clients/client14/web16/web/crmdev/adodb/adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADOConnection.Execute(INSERT INTO vtiger_cvcolumnlist(cvid,columnindex,columnname) VALUES(?,?,?), Array[3])</font><font color="#808080" size="-1"> % line 468, file: <a href="file://var/www/clients/client14/web16/web/crmdev/include/database/PearDatabase.php">PearDatabase.php</a></font>
<font face="Courier New,Courier">PearDatabase.pquery(INSERT INTO vtiger_cvcolumnlist(cvid,columnindex,columnname) VALUES(?,?,?), Array[3])</font><font color="#808080" size="-1"> % line 147, file: <a href="file://var/www/clients/client14/web16/web/crmdev/vtlib/Vtiger/Filter.php">Filter.php</a></font>
<font face="Courier New,Courier">Vtiger_Filter.addField(Object:Vtiger_Field)</font><font color="#808080" size="-1"> % line 131, file: <a href="file://var/www/clients/client14/web16/web/crmdev/create_zipcode.php">create_zipcode.php</a></font>
</pre><pre align="left"><br></pre>I compared with other entities module that I already create and I think that problem is related with this:</div><div><br></div><div>(mysql): UPDATE vtiger_cvcolumnlist SET columnindex=columnindex+1 WHERE
cvid=NULL AND columnindex>=0 ORDER BY columnindex DESC
<hr>
<hr>
(mysql): INSERT INTO vtiger_cvcolumnlist(cvid,columnindex,columnname)
VALUES(NULL,0,'vtiger_zipcode:zipcodename:zipcodename:ZipCode_LBL_ZIPCODE_NAME:V') </div><div><br></div><div>For some reason the cvid is setting as NULL, but I could not figure out the reason.</div><div><br></div>
<div>This is a sample where it works perfectly:</div><div><br></div><div>mysql): INSERT INTO vtiger_entityname(tabid, modulename, tablename,
fieldname, entityidfield, entityidcolumn)
VALUES(61,'PoliticalParty','vtiger_politicalparty','politicalpartyacronym','politicalpartyid','politicalpartyid')
<hr>
Setting entity identifier ... DONE<br><hr>
(mysql): update vtiger_customview_seq set id=LAST_INSERT_ID(id+1);
<hr>
<hr>
(mysql): INSERT INTO vtiger_customview(cvid,viewname,setdefault,setmetrics,entitytype) VALUES(64,'All',1,0,'PoliticalParty')
<hr>
Creating Filter All ... DONE<br><hr>
(mysql): UPDATE vtiger_customview SET status='0' WHERE cvid=64
<hr>
Setting Filter All to status [0] ... DONE</div><div><br></div><div>This is something that really driving me nuts, if someone could give me some help to understand why the error occurs, please let me know.</div><div><br></div>
<div>Thanks in advance</div><div> </div>