Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird thing on 'getSalesEntityType'
#1
I'm creating a new custom workflow (working nicely through cbUpdater, had to learn it sometime). Now I took some of Joe's scripts as a starting point and noticed something weird:

PHP Code:
list($acc,$acc_id) = explode('x',$entity->data['id']);  // separate webservice ID
    
if (getSalesEntityType($acc_id)=='Accounts') {
        list(
$usr,$usr_id) = explode('x'$entity->data['assigned_user_id']);
        
$query 'update vtiger_crmentity set smownerid=? where crmid in (select contactid from vtiger_contactdetails where accountid=?)';
        
$params = array($usr_id$acc_id);
        
$adb->pquery($query$params);
    } 

The 'getSalesEntityType' is used to check if we are actually working with an account here, by checking against the string 'Accounts'. But when I look up function (https://github.com/vtiger-crm/vtigercrm/...#L475-L485) if specifically says: 'returns the tabid, integer type'. So great that it works, but it shouldn't... In the meantime, I checked the setype column in the vtiger_crmentity table and yes, this is a string, not an integer. Just thought I'd point out the comment on the function is wrong.

UPDATE

Just saw I had asked this already in a different thread a couple of months ago....
Reply


Messages In This Thread
Weird thing on 'getSalesEntityType' - by Guido1982 - 07-06-2016, 08:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)