[Vtigercrm-developers] Create entity task in Workflow

salim salimcmd at gmail.com
Tue Mar 5 03:45:18 PST 2013


Hi Al,
  Thanks man, I am getting a error now. when i save Opportunity stage as
closed as won
I am getting this error.

Parse error: syntax error, unexpected T_FUNCTION in
/var/www/vtiger6/include/CreatProject.php on line 15 Call Stack: 0.0002
340996 1. {main}() /var/www/vtiger6/vtiger6/index.php:0 0.1891 25404860 2.
Vtiger_WebUI->process() /var/www/vtiger6/vtiger6/index.php:19 0.2966
28802720 3. Vtiger_Save_Action->process()
/var/www/vtiger6/vtiger6/main/WebUI.php:159 0.2966 28802720 4.
Vtiger_Save_Action->saveRecord()
/var/www/vtiger6/vtiger6/modules/Vtiger/actions/Save.php:23 0.3836 29627436
5. Vtiger_Record_Model->save()
/var/www/vtiger6/vtiger6/modules/Vtiger/actions/Save.php:45 0.3836 29627436
6. Vtiger_Module_Model->saveRecord()
/var/www/vtiger6/vtiger6/modules/Vtiger/models/Record.php:196 0.3841
29636004 7. CRMEntity->save()
/var/www/vtiger6/vtiger6/modules/Vtiger/models/Module.php:148 0.6292
30004612 8. VTEventsManager->triggerEvent()
/var/www/vtiger6/data/CRMEntity.php:854 0.6292 30004940 9.
VTEventTrigger->trigger()
/var/www/vtiger6/include/events/VTEventsManager.inc:118 0.6407 30341756 10.
VTWorkflowEventHandler->handleEvent()
/var/www/vtiger6/include/events/VTEventTrigger.inc:143 0.9870 33009116 11.
Workflow->performTasks()
/var/www/vtiger6/modules/com_vtiger_workflow/VTEventHandler.inc:98 0.9886
33035948 12. VTEntityMethodTask->doTask()
/var/www/vtiger6/modules/com_vtiger_workflow/VTWorkflowManager.inc:281
0.9887 33036256 13. VTEntityMethodManager->executeMethod()
/var/www/vtiger6/modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc:19

This the code that i used to register the function

<?php
require_once 'include/utils/utils.php';
require 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
$emm = new VTEntityMethodManager($adb);
$emm->addEntityMethod("Potentials", "Create Project from potential",
"include/CreatProject.php", "Project_WorkflowTask_AutoCreateFn");
?>

And this my php -v output,

PHP 5.3.10-1ubuntu3.5 with Suhosin-Patch (cli) (built: Jan 18 2013
23:45:59)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies


Thanks
--
Salim


On 5 March 2013 15:36, Alan Lord <alanslists at gmail.com> wrote:

> On 05/03/13 08:27, salim wrote:
> > Hi All,
> >      I need to create a project when a Opportunity get closed as won. So
> > to accomplish this i am using workflow. But when i select *Create Entity
> > * from workflow task, There is no Project module Listed in the list, I
> > can see only Comment Module.
>
> So - a couple of years ago (before the create entity task was available
> in the Workflow module) I created a custom function that does almost
> exactly what you want.
>
> http://pastebin.com/j38LujTy
>
> This may be easier than creating additional fields and relationships
> that might not be necessary.
>
> Cheers
>
> Al
>
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 
Muhammed Abdul Salim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130305/6f1a4da6/attachment.html 


More information about the vtigercrm-developers mailing list