[Vtigercrm-developers] Question about Save New Entity Module - 5.4.0

Adam Heinz amh at metricwise.net
Thu Jul 12 07:06:20 PDT 2012


Yes, all entities require that vtiger_crmentity.smownerid be
populated.  That field has a large role in determining who has access
to the entity.

$field = new Vtiger_Field();
$field->label = 'Assigned To';
$field->name = 'assigned_user_id';
$field->column = 'smownerid';
$field->table = 'vtiger_crmentity';
$field->uitype = 52; // User picklist
$field->typeofdata = 'I~M';
$block->addField($field);


On Wed, Jul 11, 2012 at 9:04 PM, possebon <possebon at gmail.com> wrote:
> Hi all,
>
> I'm having an issue for every New Entity Module that I create.
>
> I create all my new entities modules using as base the Payslip sample
> (including the ModuleDir/5.4.0)
>
> When I try to save a record for the new entity, I'm getting this error
> message:
>
> Sorry! Attempt to access restricted file.
>
> I enabled the database debug (include/database/PearDatabase.php) and I can
> see this error message:
>
> 1048: Column 'smownerid' cannot be null
>
>                ADOConnection._Execute(insert into vtiger_crmentity
> (crmid,smcreatorid,smownerid,setype,description,modifiedby,createdtime,modifiedtime)
> values(8,'1',N...) % line  842, file: adodb.inc.php
>             ADOConnection.Execute(insert into vtiger_crmentity
> (crmid,smcreatorid,smownerid,setype,description,modifiedby,createdtime,modifiedtime)
> values(?,?,?,?..., Array[8]) % line  468, file: PearDatabase.php
>          PearDatabase.pquery(insert into vtiger_crmentity
> (crmid,smcreatorid,smownerid,setype,description,modifiedby,createdtime,modifiedtime)
> values(?,?,?,?..., Array[8]) % line  348, file: CRMEntity.php
>       CRMEntity.insertIntoCrmEntity(PoliticalParty, ) % line   84, file:
> CRMEntity.php
>    CRMEntity.saveentity(PoliticalParty, ) % line  801, file: CRMEntity.php
>
>
> My question is, is it obligatory have a smownerid field on all entities
> module? Should I create one?
>
> Thanks in advance
>
>
> _______________________________________________
> http://www.vtiger.com/


More information about the vtigercrm-developers mailing list