PowerSync offers system integrators and developers a way to initiate data synchronization from Magento into Salesfoce via PHP code or prevent synchronization all together.

Triggering Product Synchronization

Following code will allow system integrators and developers to manually trigger synchronization of a Magento product with Salesforce. Where $object is a Magento native product object.

Mage::dispatchEvent('tnw_catalog_product_save', array('product' => $object));

Triggering Customer Synchronization

Following code will allow system integrators and developers to manually trigger synchronization of a Magento customer with Salesforce. Where $object is a Magento native customer object.

Mage::dispatchEvent('tnw_customer_save', array('customer' => $object));

Triggering Order Synchronization

Following code will allow system integrators and developers to manually trigger synchronization of a Magento order with Salesforce. Where $object is a Magento native order object.

Mage::dispatchEvent('tnw_sales_order_save', array('order' => $object));

Bypassing Synchronization

PowerSync relies on native Magento events to trigger entity synchronization. Following are examples which you could use to prevent automated entity synchronization from Magento into Salesforce.

/* Following code will allow you to bypass product synchronization with Salesforce */ Mage::getSingleton('core/session')->setFromSalesForce(true); // $object could be Magento 'product', 'customer', 'order', 'invoice', 'shipment', etc... $object->save(); Mage::getSingleton('core/session')->setFromSalesForce(false);