CoreBOSBB

Full Version: Weird thing on 'getSalesEntityType'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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/blob/master/include/utils/CommonUtils.php#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....
No problem, I just setup my first cbUpdater record to install a workflow method, so learning to use the app as intended. By the way: did you get a chance to check out the theme BETA?
No not yet. I'll get back to you as soon as I can.
No problem, just was curious if the post was read since it's quite an old thread.
Yes, I get notified of all changes: I am subscribed to all forums.
Nice effort