<div dir="ltr">Hi,<div><br></div><div><span style="font-size:12.8px">I've been working on a Vtiger module that sends the data of a saved Invoice to a third party API.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I'm using a Event Handler to retrieve the data from the Invoice module and process it to send it to the third party API.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">After finishing the module i started testing it and it worked great except for returning empty </span><span style="font-size:12.8px">entry's  </span><span style="font-size:12.8px">to the database from time to time.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">When i looked into what caused the empty entry's i found out that it was caused by the save of other modules.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But i thought the Event Handler will only run for the Module that was registered in the </span>Vtiger_Event::register ?</div><div><br></div><div>Is this not the case or am i just doing something wrong ?</div><div><br></div><div>My Vtiger event register code:</div><div><br></div><div><div>        public function registerInvoiceEvent(){</div><div>            if(Vtiger_Event::hasSupport()) {</div><div>                  Vtiger_Event::register(</div><div>                        'Invoice', 'vtiger.entity.aftersave',</div><div>                        'ReeleezeeHandler', 'modules/Reeleezee/ReeleezeeHandler.php'</div><div>                  );</div><div>            }</div><div>        }</div></div><div><br></div><div>My Event handler code:</div><div><br></div><div><div>class ReeleezeeHandler extends VTEventHandler {</div><div><br></div><div><span class="" style="white-space:pre">    </span>public $helper = null;</div><div><br></div><div><span class="" style="white-space:pre">     </span>public function __construct(){</div><div><span class="" style="white-space:pre">            </span>require 'modules/Reeleezee/Helper.php';</div><div><span class="" style="white-space:pre">            </span>$this->helper = new Reeleezee_Helper();</div><div><span class="" style="white-space:pre">  </span>}</div><div><br></div><div><span class="" style="white-space:pre">        </span>  function handleEvent($eventName, $data) {</div><div><br></div><div><br></div><div><span class="" style="white-space:pre">     </span>        if($eventName == 'vtiger.entity.aftersave') {</div><div><span class="" style="white-space:pre">  </span>        <span class="" style="white-space:pre">      </span>if ($data) {</div><div><span class="" style="white-space:pre">       </span>            <span class="" style="white-space:pre">        </span>$moduledata = $data->getData();</div></div><div>                        //More code here but don't think it's relevant</div><div>                }</div><div>          }</div><div>}</div><div><br></div><div>Can anybody give me a push in the right direction for why this is happening ?</div><div><br></div><div><br></div><div>Thanks in advance!</div><div><br></div><div><br></div><div>Kind regards,</div><div><br></div><div>Lennart</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div>