I am new to magento, I have created custom module front and backend(admin) module, working fine except edit.
in grid bind the data correctly with id
http://localhost/magento/index.php/test/adminhtml_index/edit/id/1/key/ef47aec44d98d1201d27fcdc732243a3
.
but when I click on edit I redirected to edit page and I did debug also, but record id is not getting.
public function editAction()
{
$testId = $this->getRequest()->getParam('test_id');
//id is not getting
Mage::log($testId);
$testModel = Mage::getModel('quotes/quotes')->load($testId);
.....
}
if I pass/hard coded from here I got a details of record id
$testModel = Mage::getModel('quotes/quotes')->load(1);
can any one tell me where I went wrong?
thanks
Best Answer
What index did you give your entity?
I usually use
id
as a primary key, and am able to load it by getting the associated paramter.As per comment:
Then in your form file
app/code/codepool/Quotes/Quotes/Block/Adminhtml/Quotes/Edit/Form.php