[Vtigercrm-developers] getting invoice id and product id during event processing

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Wed Jul 23 04:28:47 GMT 2014


Thanks Rishab

The piece of the puzzle I was missing was $data->GetId(); I mistakenly thought that invoiceid was part of the data returned by $data->getData();

Chris


From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Rishab K
Sent: Tuesday, 22 July 2014 3:44 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] getting invoice id and product id during event processing

Chris,

You can find the information about the invoice which is being created in InvoiceHandler.php(handleEvent Api).
Products related to to the invoice are stored in separate table(vtiger_inventoryproductrel)

example query to fetch the products related to invoice will be

SELECT productid FROM vtiger_inventoryproductrel INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_inventoryproductrel.productid AND vtiger_crmentity.deleted=0 WHERE id = '?';

id will be the invoiceid on which the event is getting triggered.

On Tue, Jul 22, 2014 at 7:04 AM, Hamono, Chris (DPC) <Chris.Hamono at sa.gov.au<mailto:Chris.Hamono at sa.gov.au>> wrote:
I need to do some post processing when a new invoice is created.

It appears that when a new invoice is created and the onaftersave event is fired there is neither a productid nor an invoiceid in the invoice object sent to the event.

1/ When are they created?
2/ How do I find this information?

The invoice is being created programmatically if that makes a difference

Chris


_______________________________________________
http://www.vtiger.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140723/51b5cac5/attachment-0001.html>


More information about the vtigercrm-developers mailing list