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

Preexo preexo at googlemail.com
Tue Dec 8 06:59:55 GMT 2015


+1 for workflows. Start reading here:
https://wiki.vtiger.com/index.php/Invoke_Custom_Function It pretty much
explains how to get a custom function going.
In the custom function to get access to your just saved entity like this
(I'm still not sure if that is already the prettiest way, but it works for
me):

function updateSalesOrderCurrencyExchangeRate($entity){
    // retrieve ID from entity
    $entity_id = vtws_getIdComponents($entity->getId());
    $entity_id = $entity_id[1];
    // retrieve SalesOrder object from ID
    $salesOrderRecord = Vtiger_Record_Model::getInstanceById($entity_id,
"SalesOrder");
    // example echo the custom field cf_1000
    echo $salesOrderRecord->get('cf_1000'); exit;
}

I'm doing stuff like this all the time, sending data to a third party API.
Just remember to



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-How-to-get-data-from-Invoices-module-from-within-my-module-tp17940p17943.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.


More information about the vtigercrm-developers mailing list