AnsweredAssumed Answered

Reinstalling updated version of a module with custom fields.

Question asked by André Policarpo on Aug 5, 2016
Latest reply on Aug 30, 2016 by André Policarpo

Hi,

 

My module is currently installing three custom fields in the manifest in the following way:

'custom_fields' => array(
        array(
            'name' => 'my_recording',
            'label' => 'LBL_MY_RECORDING',
            'type' => 'url',
            'module' => 'Calls',
            'help' => '',
            'comment' => 'My recording URL.',
            'default_value' => '',
            'max_size' => 255,
            'required' => false, // true or false
            'reportable' => true, // true or false
            'audited' => false, // true or false
            'importable' => 'true', // 'true', 'false', 'required'
            'duplicate_merge' => true, // true or false
        ),
        array(
            'name' => 'my_bo',
            'label' => 'LBL_ONECONTACT_BO',
            'type' => 'varchar',
            'module' => 'Calls',
            'help' => '',
            'comment' => 'My business outcome',
            'default_value' => '',
            'max_size' => 255,
            'required' => false, // true or false
            'reportable' => true, // true or false
            'audited' => false, // true or false
            'importable' => 'true', // 'true', 'false', 'required'
            'duplicate_merge' => true, // true or false
        ),
        array(
            'name' => 'my_media',
            'label' => 'LBL_MY_MEDIA',
            'type' => 'varchar',
            'module' => 'Calls',
            'help' => '',
            'comment' => 'My media type.',
            'default_value' => '',
            'max_size' => 255,
            'required' => false, // true or false
            'reportable' => true, // true or false
            'audited' => false, // true or false
            'importable' => 'true', // 'true', 'false', 'required'
            'duplicate_merge' => true, // true or false
        ),

Everything is working fine but when I alter my module and install upon the older version it always gives the "database failure" error and i have to manually delete the custom fields in studio. Is there any way that Sugar knows that the fields already exist and doesn't try to add them to the database again?

 

Thanks in advance,

André Policarpo

Outcomes