[Vtigercrm-developers] How to get data from Invoices module from within my module

Lennart van Ballegoij lennart at egmmedia.nl
Wed Dec 9 16:18:24 GMT 2015


Hey Alan,

Thanks for the info, Only it doesn't seem to work like i expected.
I enabled the Vtiger Logging in config.performance.php like this {
'LOG4PHP_DEBUG' => true, }

The vtigercrm.log has been created only i don't get any data in it after a
invoice save.

My function to register the event is {

        public function registerInvoiceEvent(){
            if(Vtiger_Event::hasSupport()) {
                  Vtiger_Event::register(
                        'Invoice', 'vtiger.entity.aftersave',
                        'ReeleezeeHandler',
'modules/Reeleezee/ReeleezeeHandler.php'
                  );
            }
        }

}

Am i doing something wrong here ?

I thought it might have something to do with the Permissions on my server
but it looks like these are okey.


Can anybody point me in the right direction.

Thanks in advance!!


Kind regards,

Lennart






2015-12-09 10:22 GMT+01:00 Alan Lord <alanslists at gmail.com>:

> On 09/12/15 00:32, Lennart van Ballegoij wrote:
>
>>
>> My Event Handler so far:
>>
>> <?php
>> class ReeleezeeHandler extends VTEventHandler {
>> function handleEvent($eventName, $data) {
>>         if($eventName == 'vtiger.entity.aftersave') {
>> if ($data->isNew()) {
>> // Create of new record
>> print_r($data);
>>         } else {
>>             // Edit of older record
>>         }
>>         }
>>     }
>> }
>> ?>
>>
>> Can someone maybe give me push in the right direction?
>>
>
> enable vtiger logging, add global $log to your function then type
> something like:
>
> $log->debug(print_r($data,true));
>
> This will then be printed to the logs/vtigercrm.log file
>
> HTH
>
> Al
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20151209/5b813f44/attachment.html>


More information about the vtigercrm-developers mailing list