Call Product Flat table indexing programatically

You can use this snippet in the afterSave() function of class MageCatalogModelProduct

//Mage::getSingleton('index/indexer')->processEntityAction( // $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE //); $storeId = $this->getStoreId(); $productId = $this->getId(); $productFlatIndexer = Mage::getSingleton('catalog/product_flat_indexer'); $productIds = array($productId); if($storeId !=0 && $storeId !=1){ $productFlatIndexer->updateProduct($productIds,$storeId); }else{ $productFlatIndexer->updateProduct($productIds); }