Hi Nicolas,<div><br></div><div>There is another parameter for the register api, which lets you specify the condition on which you want the event to be triggered. The type of condition allowed is something like &quot;module IN (&#39;Accounts&#39;)&quot;.</div>

<div><br></div><div>But unfortunately, we have an issue in parsing the condition and hence the condition part is not working right now.</div><div><br></div><div>As a workaround, you can add a condition in your event handler, to perform the action only if the module is &#39;Accounts&#39;.</div>

<div>For eg:</div><div>Something like below would workout for you:</div><div><br></div><div><div>if($eventName == &#39;vtiger.entity.aftersave&#39;) {<span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>

<span class="Apple-tab-span" style="white-space:pre">                        </span>$moduleName = $entityData-&gt;getModuleName();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>if ($moduleName == &#39;Accounts&#39;) {</div>

</div><div>                                .......</div><div>                        }</div><div>}</div><div><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 11:50 PM, Nicolas Larcipretti <span dir="ltr">&lt;<a href="mailto:niclarcipretti@gmail.com">niclarcipretti@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi folks,<br><br>I&#39;m having some trouble registering events on vtiger. I register them giving a specific module by parameter, but it seem to be applying the event for every single module in the system. <br>

<br>Example:<br>
<br>require_once(&#39;vtlib/Vtiger/Module.php&#39;);<br><br>$modulo = Vtiger_Module::getInstance(&#39;Accounts&#39;);<br><br>$evento = Vtiger_Event::register($modulo,&#39;vtiger.entity.beforesave&#39;,&#39;MyClass&#39;,&#39;myclass.php&#39;);<br>


<br>This event triggers everytime I save an account, but it also triggers when I save a Contact. Why vtiger is not respecting the module I gave when I create the event? Is there any workaround to this issue?<br><br>Cheers,<br>

<font color="#888888">
<br>Nicolas<br><br>
</font><br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Asha<br>vtiger Team<br><br><b>Connect with us on: </b><a href="http://twitter.com/#%21/vtigercrm" target="_blank">Twitter</a> <b>I</b> <a href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" target="_blank">Facebook</a> <b>I</b> <a href="http://blog.vtiger.com/" target="_blank">Blog</a><b> I</b> <a href="http://wiki.vtiger.com/index.php/Main_Page" target="_blank">Wiki</a> <b>I </b><a href="http://forums.vtiger.com/" target="_blank">Forums </a><b>I</b> <a href="http://vtiger.com/" target="_blank">Website</a><br>

<br>
</div>