Module Causing Mysqli Query - Duplicate Auto Increment Fields

Hello Community & Support Team,

I am new to SuiteCRM and finding my way around. Recently I installed a module to generate a unique record ID to be used in marketing campaigns for tracking purposes.

It allows you to create a unique field that auto increments. However, these fields are not created as custom fields. During testing of this module, I managed to create more than one auto_increment field which is causing a problem with the Repair process and now I’m unable to license the module (after reinstalling) as the repair query is trying to run before the license validates.

When I thought I was deleting fields through the module they were just being hidden from the module UI and remained visible in Studio and I can’t delete them from the front end UI as they are not custom fields.

The error I’m getting is as follows (I’ve sanitised the paths for security)

Wed Apr 22 08:51:37 2020 [22732][1][FATAL] Mysqli_query failed.
Wed Apr 22 08:51:37 2020 [22732][1][FATAL] Query Failed: ALTER TABLE prospects add COLUMN test_field_for_removal int(11) NOT NULL auto_increment, add COLUMN target_id int(11) NOT NULL auto_increment, add COLUMN target_tracking_id int(11) NOT NULL auto_increment, ADD CONSTRAINT UNIQUE idx_test_field_for_removal (test_field_for_removal), ADD CONSTRAINT UNIQUE idx_target_id (target_id), ADD CONSTRAINT UNIQUE idx_target_tracking_id (target_tracking_id): MySQL error 1075: Incorrect table definition; there can be only one auto column and it must be defined as a key
Wed Apr 22 08:51:37 2020 [22732][1][FATAL] Exception handling in /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php:400
Wed Apr 22 08:51:37 2020 [22732][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Wed Apr 22 08:51:37 2020 [22732][1][FATAL] backtrace:
#0 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/database/DBManager.php(353): sugar_die(‘Database failur…’)
#1 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/database/DBManager.php(328): DBManager->registerError(’ Query Failed: …’, ’ Query Failed: …’, ‘Error with MySQ…’)
#2 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/database/MysqliManager.php(179): DBManager->checkError(’ Query Failed: …’, ‘Error with MySQ…’)
#3 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/database/MysqlManager.php(625): MysqliManager->query(‘ALTER TABLE pro…’, ‘Error with MySQ…’)
#4 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/database/DBManager.php(764): MysqlManager->repairTableParams(‘prospects’, Array, Array, true, NULL)
#5 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/modules/Administration/repairDatabase.php(122): DBManager->repairTable(Object(Prospect), true)
#6 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/modules/Administration/QuickRepairAndRebuild.php(142): include_once(’/home/THEACCOUNT/…’)
#7 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/modules/Administration/QuickRepairAndRebuild.php(124): RepairAndClear->repairDatabase()
#8 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/custom/outright_utils/core/common/outright_installation_utils.php(18): RepairAndClear->repairAndClearAll(Array, Array, true, false)
#9 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/custom/modules/outr_outr_licence/list_view_hook.php(39): outright_do_repair()
#10 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/utils/LogicHook.php(272): add_list_view_button->outright_finish_license(Object(outr_outr_licence), ‘before_save’, Array)
#11 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/utils/LogicHook.php(208): LogicHook->process_hooks(Array, ‘before_save’, Array)
#12 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/data/SugarBean.php(3112): LogicHook->call_custom_logic(‘outr_outr_licen…’, ‘before_save’, Array)
#13 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/data/SugarBean.php(2375): SugarBean->call_custom_logic(‘before_save’, Array)
#14 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php(684): SugarBean->save(false)
#15 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php(525): SugarController->action_save()
#16 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php(494): SugarController->do_action()
#17 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php(468): SugarController->handle_action()
#18 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/Controller/SugarController.php(373): SugarController->process()
#19 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/include/MVC/SugarApplication.php(113): SugarController->execute()
#20 /home/THEACCOUNT/crm.THEDOMAIN.MY.EXT/index.php(52): SugarApplication->execute()
#21 {main}

What I’m looking for is some guideance to help clear up this mess so that I can determine if this module is worth pursuing further or it was entirely operator error (me).

Many thanks,



if this is an add-on you purchased from the SuiteCRM Store, the correct place to get support would be from their page there, it has a tab where you can open “issues” and get responses from add-on developers.

It wasn’t purchased through the store @pgr and I was preparing incase the developer didn’t respond I needed to resolve things as they don’t have a standard support channel. Never the less they are now resolving the matter so I’m leaving it with them. Feel free to set this thread to resolved.

1 Like

Sorry can I ask you the name of the form? I was also looking for something like this that would create an id field for the business module and that didn’t cost much

The extension I purchased was $99 - is that an acceptable price? It will autoincrement for any module and they are completing development to support prefix and suffix by next week. Let me know if you want more details.