[Vtigercrm-developers] Create new entity

Christophe Humbert chrissc.humbert at gmail.com
Mon Mar 21 06:22:13 GMT 2016


Hello

did you check the permissions of your custom extensions files on the server?

KR
On Mar 21, 2016 5:17 AM, "Preexo" <preexo at googlemail.com> wrote:

> I am extending a custom extension with an AJAX action which is going to
> create new Asset entities. But at the moment I am struggling with the
> creation of new Assets. I am creating a new asset like this:
>
>                 $adb = PearDatabase::getInstance();
>                 $entity = CRMEntity::getInstance("Assets");
>                 $crmEntityId = $adb->getUniqueID('vtiger_crmentity');
>                 $entity->setModuleSeqNumber("increment","Assets");
>                 $assetRecord =
> Vtiger_Record_Model::getCleanInstance("Assets");
>                 $assetRecord->set('mode','edit');
>                 $assetRecord->setEntity($entity);
>                 $assetRecord->setId($crmEntityId);
>                 $assetRecord->set("serialnumber", "foobar");
>                 $ret = $assetRecord->save();
>                 var_dump($ret);exit;
>
> But I always get the message "Sorry! Attempt to access restricted file."
> when calling the save method, all other things work fine.
>
> I think I am not correctly creating the entity, what am I missing?
> Thanks for any help!
>
>
>
> --
> View this message in context:
> http://vtiger-crm.2324883.n4.nabble.com/Create-new-entity-tp18679.html
> Sent from the vtigercrm-developers mailing list archive at Nabble.com.
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20160321/d1d5e544/attachment.html>


More information about the vtigercrm-developers mailing list