By default when we create new admin user, it has the fields for Username, First Name, Last Name, Email id, Password, etc.

I want to create new field to save mobile number of all admin users and want to list all admin's with contact numbers while creating order shipment, but I'm not getting how to do it.

Please help me to sort out this issue.

Thanks in advance.

1 Answer 1


To add new field in admin user form, first of all you need to create a new column in admin_user table.


/* @var $installer Mage_Customer_Model_Resource_Setup */
$installer = $this;

$user = $this->getTable('admin/user');
    ALTER TABLE  $user ADD  `mobile` varchar(255) NOT NULL


Then you need to observer adminhtml_block_html_before event to add new field in admin user form.


<?xml version="1.0"?>


class {Namespace}_{Module}_Model_Observer
   public function addMobileField(Varien_Event_Observer $observer) {
        $block = $observer->getEvent()->getBlock();
        if (!isset($block)) {
            return $this;
        if ($block->getType() == 'adminhtml/system_account_edit_form') {
            $form = $block->getForm();

            $fieldset = $form->getElement('base_fieldset');

            //add new website field
            $fieldset->addField('mobile', 'text', array(
                    'name'  => 'mobile',
                    'label' => Mage::helper('adminhtml')->__('Mobile No.'),
                    'title' => Mage::helper('adminhtml')->__('Mobile No.'),
                    'required' => false,

            $userId = Mage::getSingleton('admin/session')->getUser()->getId();
            $user = Mage::getModel('admin/user')

And at last, you need to override Mage_Adminhtml_System_AccountController controller file to save mobile field.

 * Saving edited user information
public function saveAction()
        ->setUsername($this->getRequest()->getParam('username', false))
        ->setFirstname($this->getRequest()->getParam('firstname', false))
        ->setLastname($this->getRequest()->getParam('lastname', false))
        ->setEmail(strtolower($this->getRequest()->getParam('email', false)))
        ->setMobile($this->getRequest()->getParam('mobile', false));
  • Thank you very much for your reply. This solution helped me, Field for mobile number is visible in 'My Account' form of admin. But saveAction() of controller is not executed. How to do it?
    – Ajinkya
    Nov 28, 2017 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.