I am working on a custom module which has custom tables and I need to pull through some extra data to an admin product grid.
I have already got several custom columns which work great like so:
//protected function _prepareCollection()
// protected function _prepareColumns()
'header' => Mage::helper('custom')->__('Custom Title'),
'index' => 'custom',
'width' => '150px',
'type' => 'number'
I now need to add one more column which is the difference between the values in two columns. I know that I can do this using addExpressionAttributeToSelect like this:
This works fine on standard attributes which would be otherwise added via “addAttributeToSelect” however, I need one of my columns to be my custom column which was added to the collection via “joinField”. As soon as I substitute the attributes, my admin dies.
For some reason I get a report ID in the URL but the screen is just the white screen of death, and there is no report saved and nothing in the exception log. Without any debug output it is extremely difficult to know what is wrong! I am guessing its something to do with subqueries and my custom column data not being available at that time.
Does anyone know how I can get my custom difference data into the collection so that it is available to display as a column?