<p dir="ltr">Hello</p>
<p dir="ltr">did you check the permissions of your custom extensions files on the server?</p>
<p dir="ltr">KR</p>
<div class="gmail_quote">On Mar 21, 2016 5:17 AM, "Preexo" <<a href="mailto:preexo@googlemail.com">preexo@googlemail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am extending a custom extension with an AJAX action which is going to<br>
create new Asset entities. But at the moment I am struggling with the<br>
creation of new Assets. I am creating a new asset like this:<br>
<br>
$adb = PearDatabase::getInstance();<br>
$entity = CRMEntity::getInstance("Assets");<br>
$crmEntityId = $adb->getUniqueID('vtiger_crmentity');<br>
$entity->setModuleSeqNumber("increment","Assets");<br>
$assetRecord =<br>
Vtiger_Record_Model::getCleanInstance("Assets");<br>
$assetRecord->set('mode','edit');<br>
$assetRecord->setEntity($entity);<br>
$assetRecord->setId($crmEntityId);<br>
$assetRecord->set("serialnumber", "foobar");<br>
$ret = $assetRecord->save();<br>
var_dump($ret);exit;<br>
<br>
But I always get the message "Sorry! Attempt to access restricted file."<br>
when calling the save method, all other things work fine.<br>
<br>
I think I am not correctly creating the entity, what am I missing?<br>
Thanks for any help!<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtiger-crm.2324883.n4.nabble.com/Create-new-entity-tp18679.html" rel="noreferrer" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Create-new-entity-tp18679.html</a><br>
Sent from the vtigercrm-developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>