[Vtigercrm-developers] New Entity Module: 1048: Column 'cvid' cannot be null

possebon possebon at gmail.com
Wed Jul 11 18:13:45 PDT 2012


Hi,

I'm trying to create a new entity module (ZipCode) where I plan to store
all zipcodes from my country.

If I don't have the database debugging enabled, I receive OK message.

When I enable database debugging, I receive this error message:

1048: Column 'cvid' cannot be null

      ADOConnection._Execute(INSERT INTO
vtiger_cvcolumnlist(cvid,columnindex,columnname)
VALUES(NULL,0,'vtiger_zipcode:zipcodename:zipcodename:ZipCode_LBL_Z...)
% line  842, file: adodb.inc.php
<file://var/www/clients/client14/web16/web/crmdev/adodb/adodb.inc.php>
   ADOConnection.Execute(INSERT INTO
vtiger_cvcolumnlist(cvid,columnindex,columnname) VALUES(?,?,?),
Array[3]) % line  468, file: PearDatabase.php
<file://var/www/clients/client14/web16/web/crmdev/include/database/PearDatabase.php>PearDatabase.pquery(INSERT
INTO vtiger_cvcolumnlist(cvid,columnindex,columnname) VALUES(?,?,?),
Array[3]) % line  147, file: Filter.php
<file://var/www/clients/client14/web16/web/crmdev/vtlib/Vtiger/Filter.php>Vtiger_Filter.addField(Object:Vtiger_Field)
% line  131, file: create_zipcode.php
<file://var/www/clients/client14/web16/web/crmdev/create_zipcode.php>


I compared with other entities module that I already create and I think
that problem is related with this:

(mysql): UPDATE vtiger_cvcolumnlist SET columnindex=columnindex+1 WHERE
cvid=NULL AND columnindex>=0 ORDER BY columnindex DESC
------------------------------
------------------------------
(mysql): INSERT INTO vtiger_cvcolumnlist(cvid,columnindex,columnname)
VALUES(NULL,0,'vtiger_zipcode:zipcodename:zipcodename:ZipCode_LBL_ZIPCODE_NAME:V')


For some reason the cvid is setting as NULL, but I could not figure out the
reason.

This is a sample where it works perfectly:

mysql): INSERT INTO vtiger_entityname(tabid, modulename, tablename,
fieldname, entityidfield, entityidcolumn)
VALUES(61,'PoliticalParty','vtiger_politicalparty','politicalpartyacronym','politicalpartyid','politicalpartyid')

------------------------------
Setting entity identifier ... DONE
------------------------------
(mysql): update vtiger_customview_seq set id=LAST_INSERT_ID(id+1);
------------------------------
------------------------------
(mysql): INSERT INTO
vtiger_customview(cvid,viewname,setdefault,setmetrics,entitytype)
VALUES(64,'All',1,0,'PoliticalParty')
------------------------------
Creating Filter All ... DONE
------------------------------
(mysql): UPDATE vtiger_customview SET status='0' WHERE cvid=64
------------------------------
Setting Filter All to status [0] ... DONE

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.

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20120711/ddba9d8d/attachment.html 


More information about the vtigercrm-developers mailing list