[Vtigercrm-developers] Error when adding ToDo from SO/Inv/PO
John Crisp
john at reetspetit.net
Mon Oct 17 09:23:16 PDT 2011
On 17/10/11 17:52, John Crisp wrote:
> I have had an odd situation that I cannot resolve. I have tested this on
> the demo server and it works but not on my installation. I can only
> assume a mod somewhere has upset things but cannot see what.
>
> When adding a ToDo to a SO/Inv/PO I was getting a stop as follows (it
> worked fine from Accounts or Contacts)
Further to this, I realised I should have said that it was stopping on
ToDos from Accounts and Contacts which were being related to Sales Orders
Any comments appreciated. I will go back and check exactly when it is
failing as I may have got myself in a knot !
However I think the error still stands in the ComonUtils.php file
I have amended it as follows adding an extra 'else' line :
function getParentName($parent_id)
{
global $adb;
if ($parent_id == 0)
return "";
$sql="select setype from vtiger_crmentity where crmid=?";
$result=$adb->pquery($sql,array($parent_id));
//For now i have conditions only for accounts and contacts, if needed
can add more
if($adb->query_result($result,'setype') == 'Accounts')
$sql1="select accountname name from vtiger_account where accountid=?";
else if($adb->query_result($result,'setype') == 'Contacts')
$sql1="select concat( firstname, ' ', lastname ) name from
vtiger_contactdetails where contactid=?";
else $sql1="select setype from vtiger_crmentity where crmid=?";
$result1=$adb->pquery($sql1,array($parent_id));
$asd=$adb->query_result($result1,'name');
return $asd;
}
Not sure if this is right but IWFM
B. Rgds
John
More information about the vtigercrm-developers
mailing list