tnw_salesforce_invoice_products_send_before

An event is triggered before sending data in Salesforce.

TNW_Salesforce_Block_Sales_Order_Status_New_Form
Mage::dispatchEvent('tnw_salesforce_invoice_products_send_before', array('data' => $_data));

 

How to use this event:

Several steps are involved into utilizing this event:

  1. config.xml
    1. a listener should be added for this event
    2. a listener should point to a Magento Observer module and a method in that observer
  2. Magento Observer
    1. holds a method where you can add your custom logic
Example Config
<?xml version="1.0"?>
<config>
    <global>
        <events>
            <tnw_salesforce_invoice_products_send_before>
                <observers>
                    <salesforce_invoice_products_send_before_observer>
                        <class>tnw_salesforce/observer</class>
                        <method>invoiceProductsSendBefore</method>
                    </salesforce_invoice_products_send_before_observer>
                </observers>
            </tnw_salesforce_invoice_products_send_before>
        </events>
    </global>
</config>
Example Observer
<?php

/**
 * Class TNW_Salesforce_Model_Observer
 */
class TNW_Salesforce_Model_Observer
{
 
    public function invoiceProductsSendBefore(Varien_Event_Observer $observer) {
		/**
		 * Array of Salesforce objects
		 * @var stdClass[] $_data 
		 *
		 * Example:
		 * array (size=4)
		 *   'cart_230' => 
		 *     object(stdClass)[611]
		 *       public 'Id' => string 'a0H24000004UOBoEAO' (length=18)
		 *       public 'AcctSeed__Product__c' => string '01t24000003TfxyAAC' (length=18)
		 *       public 'AcctSeed__Rate__c' => string '321.55' (length=6)
		 *       public 'AcctSeed__Billing__c' => string 'a0J2400000SormDEAR' (length=18)
		 *       public 'AcctSeed__Hours_Units__c' => string '1.0000' (length=6)
		 *       public 'AcctSeedERP__Sales_Order_Line__c' => string 'a1424000001DotaAAC' (length=18)
		 *   ... 
		 */
		$_data = $observer->getData('data');

		// Your custom code
    }
 
}

 

Filter by label

There are no items with the selected labels at this time.