I have to edit the address of the customer programmatically using the address id. Here I have customer id and address id of the address to be edited. I tried the following code. But it is not working.
$customerAddress = Mage::getModel('customer/address');
$customerAddress->load($data['address_id']);
$customerAddress->setCustomerId($data['customer_id']);
$customerAddress->setWebsiteId(1);
$customerAddress->setStore(1);
$customerAddress->setFirstname('test');
$customerAddress->save();
It gives following error Call to a member function getStore() on boolean in ../app/code/core/Mage/Customer/Model/Observer.php
I need to edit all fields of the address. Can anyone help on this?