Magento – Custom Field Value Not Getting Saved

magento-1.8

I have created one custom blog module. For adminpanel Post form i have one field named "identifier". When i save the form all field values getting saved except the "identifier" field.I have tried following too

public function saveAction() {
    if ($data = $this->getRequest()->getPost('post')) {
        try {
            $data = $this->_filterDates($data, array('post_date'));
            $post = $this->_initPost(); 
            $post->setData('identifier', $data['identifier']);
            $post->addData($data);                              
            $post->save();

But not getting saved. Please help me.

Best Answer

change your code as below

        $data = $this->_filterDates($data, array('post_date'));
        $post = $this->_initPost(); 
        $post->addData($data);                              
        $post->setData('identifier', $data['identifier']);
        $post->save();