Magento Collection Join Between Different Modules

domon

New Member
I've been working on a custom module that has a backend for admin. Until now it has been working perfectly, just like the customer modules do, but now I'm stuck with this. My custom table saves the customer ID and I can show the customer name in every row of the grid. So far I'm able to show the ID, I know that I should prepare the collection, but I don't have a clue. If I use join it only works for models of the same module. I've tried this:\[code\]$collection = Mage::getModel('mymodule/mymodel')->getCollection()->getSelect() ->join( 'customer_entity', 'main_table.customer_id = customer_entity.entity_id', array('customer_name' => 'email'));\[/code\]If i print the query looks like this\[code\]SELECT `main_table`.*, `customer_entity`.`email` AS `customer_name` FROM `uhma_comunidad_question` AS `main_table` INNER JOIN `customer_entity` ON main_table.customer_id = customer_entity.entity_id\[/code\]but is returning nothing, the collection is null, if i copy this sql and paste it in phpmyadmin it works perfect, what i'm i missing hereThanks for the help.
 
Back
Top