When trying to filter sales order grid with From and To dates it was redirecting to dashboard.after that again i tried to open sales order grind it is generating reports in reports file it showing.
"Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous"
means it is finding a another created_at field. because when we adding or joining the other table then it has also a field named as created_at. So below is the solution for this error.
magento that created_at is of the main_table not of my custom table.
Find the below code in the sales order grid.php file.
That’s the Solution to solve issue...
"Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous"
means it is finding a another created_at field. because when we adding or joining the other table then it has also a field named as created_at. So below is the solution for this error.
magento that created_at is of the main_table not of my custom table.
Find the below code in the sales order grid.php file.
just replace the code with below one.$this->addColumn('created_at', array('header' => Mage::helper('sales')->__('Purchased On'),'index' => 'created_at','type' => 'datetime','width' => '100px',));
$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Purchased On'),
'index' => 'created_at',
'type' => 'datetime',
'width' => '100px',
'filter_index' => 'main_table.created_at',
));what’s the use of the following line, here created_at column of sales order grid find created_at from the main the collection .But we are getting twice created_at in the collection.So i have added the following line that this created_at is of the main table sales_flat_order not of the other table.
That’s the Solution to solve issue...
Comments
Post a Comment