<div dir="ltr">Hi Al,<div style><div style><span style="white-space:pre"> Thanks man, I am getting a error now. when i save Opportunity</span> <span style="white-space:pre">stage as closed as won</span></div><div style><span style="white-space:pre">I am getting this error.</span></div>
<div style><span style="white-space:pre"><br></span></div><div style><span style="color:rgb(0,0,0)"><font size="1" face="times new roman, serif">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</font></span><span style="white-space:pre"><br>
</span></div><div><br></div><div style>This the code that i used to register the function</div><div style><br></div><div style><font face="courier new, monospace"><?php</font></div><div style><div><font face="courier new, monospace">require_once 'include/utils/utils.php';</font></div>
<div><font face="courier new, monospace">require 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';</font></div><div><font face="courier new, monospace">$emm = new VTEntityMethodManager($adb);</font></div><div>
<font face="courier new, monospace">$emm->addEntityMethod("Potentials", "Create Project from potential", "include/CreatProject.php", "Project_WorkflowTask_AutoCreateFn");</font></div>
<div><font face="courier new, monospace">?></font></div><div><br></div><div style>And this my <font face="courier new, monospace">php -v </font><font face="arial, helvetica, sans-serif">output, </font></div><div style>
<font face="arial, helvetica, sans-serif"><br></font></div><div style><div><font face="arial, helvetica, sans-serif" size="1">PHP 5.3.10-1ubuntu3.5 with Suhosin-Patch (cli) (built: Jan 18 2013 23:45:59) </font></div><div>
<font face="arial, helvetica, sans-serif" size="1">Copyright (c) 1997-2012 The PHP Group</font></div><div><font face="arial, helvetica, sans-serif" size="1">Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies</font></div>
<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Thanks</div><div style="font-family:arial,helvetica,sans-serif">
--</div><div style="font-family:arial,helvetica,sans-serif">Salim</div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 March 2013 15:36, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/03/13 08:27, salim wrote:<br>
> Hi All,<br>
> I need to create a project when a Opportunity get closed as won. So<br>
</div>> to accomplish this i am using workflow. But when i select *Create Entity<br>
<div class="im">> * from workflow task, There is no Project module Listed in the list, I<br>
> can see only Comment Module.<br>
<br>
</div>So - a couple of years ago (before the create entity task was available<br>
in the Workflow module) I created a custom function that does almost<br>
exactly what you want.<br>
<br>
<a href="http://pastebin.com/j38LujTy" target="_blank">http://pastebin.com/j38LujTy</a><br>
<br>
This may be easier than creating additional fields and relationships<br>
that might not be necessary.<br>
<br>
Cheers<br>
<br>
Al<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Muhammed Abdul Salim<br>
</div>