My sales order table has total 17000 records. Need to select and show only last 300 records in sales order grid. I have tried the below code, but it's not working
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->limit(300);
$this->setCollection($collection);
return parent::_prepareCollection();
}
_prepareCollection
method