[Vtigercrm-developers] Workflow Custom Functions

Musavir Khan musavir at vtiger.com
Tue Aug 24 20:21:12 PDT 2010


Hi Alan,

going by memory $current_user should have current user information,
$current_user is changed only for workflow tasks other than entity method.

to get  the assigned to user i recommend using this function defined in
include/Webservices/Utils.php file,

vtws_getWebserviceEntityId('Users', $current_user->id);

On Wed, Aug 25, 2010 at 4:13 AM, Alan Lord (News) <alanslists at gmail.com>wrote:

> Following on a little further, I was playing around with trying to
> providing some more useful information in the description field of the
> newly automatically created Project module:
>
> $description =
> "This Project was automatically created when Potential No. " .
> $entity->get('potential_no') . " was changed to Status: " .
> $entity->get('sales_stage') . " by user: " .
> $entity->get('user_name') . ".\n\n" .
> $entity->get('description');
>
> Now, the interesting puzzle is how to get the *actual* user that changed
> the potential?
>
> The Workflow process itself always runs as admin from what I can tell.
>
> I'm thinking I need to check the modifiedby (and possibly smcreatorid)
> fields of the crmentity. If it isn't "1" then I know to go and get the
> username from this id. Does that sound about right? Are there any
> built-in functions to check these fields?
>
> Cheers
>
>
> Al
>
> --
> The Open Learning Centre
> http://www.theopenlearningcentre.com
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20100825/81b81652/attachment-0002.html 


More information about the vtigercrm-developers mailing list