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/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....
Reply
#2
Fixed. Thanks !!

https://github.com/tsolucio/corebos/blob/master/include/utils/CommonUtils.php#L463
Joe
TSolucio
Reply
#3
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?
Reply
#4
No not yet. I'll get back to you as soon as I can.
Joe
TSolucio
Reply
#5
No problem, just was curious if the post was read since it's quite an old thread.
Reply
#6
Yes, I get notified of all changes: I am subscribed to all forums.
Joe
TSolucio
Reply
#7
Nice effort
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)