CoreBOSBB
Weird thing on 'getSalesEntityType' - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+---- Forum: coreBOS (https://discussions.corebos.org/forumdisplay.php?fid=5)
+---- Thread: Weird thing on 'getSalesEntityType' (/showthread.php?tid=318)



Weird thing on 'getSalesEntityType' - Guido1982 - 07-06-2016

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....


RE: Weird thing on 'getSalesEntityType' - joebordes - 07-06-2016

Fixed. Thanks !!

https://github.com/tsolucio/corebos/blob/master/include/utils/CommonUtils.php#L463


RE: Weird thing on 'getSalesEntityType' - Guido1982 - 07-06-2016

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?


RE: Weird thing on 'getSalesEntityType' - joebordes - 07-06-2016

No not yet. I'll get back to you as soon as I can.


RE: Weird thing on 'getSalesEntityType' - Guido1982 - 07-06-2016

No problem, just was curious if the post was read since it's quite an old thread.


RE: Weird thing on 'getSalesEntityType' - joebordes - 07-06-2016

Yes, I get notified of all changes: I am subscribed to all forums.


RE: Weird thing on 'getSalesEntityType' - Guido1982 - 07-06-2016

Nice effort