Database failure. Please refer to suitecrm.log for details. I get this error. I get this error when I want to add custom field in studio section

Database failure. Please refer to suitecrm.log for details.

I get this error. I get this error when I want to add custom field in studio section. Many thanks to those who will help.

ERROR LOG:


Fri Sep 16 14:18:27 2022 [29668][1][FATAL] Mysqli_query failed.
Fri Sep 16 14:18:27 2022 [29668][1][FATAL] Cannot create column Query Failed: ALTER TABLE aos_products_cstm add COLUMN orj_tedarikci_no_c varchar(255) NULL : MySQL error 1146: Table ‘oxvol_finalcrm.aos_products_cstm’ doesn’t exist
Fri Sep 16 14:18:27 2022 [29668][1][FATAL] Exception handling in /home/oxvol/public_html/crm/public/legacy/include/MVC/Controller/SugarController.php:397
Fri Sep 16 14:18:27 2022 [29668][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

Suite Crm 8.1 version

[29668][1][FATAL] Mysqli_query failed.
[29668][1][FATAL] Cannot create column Query Failed: ALTER TABLE aos_products_cstm add COLUMN orj_tedarikci_no_c varchar(255) NULL : MySQL error 1146: Table ‘oxvol_finalcrm.aos_products_cstm’ doesn’t exist
[29668][1][FATAL] Exception handling in /home/oxvol/public_html/crm/public/legacy/include/MVC/Controller/SugarController.php:397
[29668][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

I looked really in the database, this is;

‘oxvol_finalcrm.aos_products_cstm’

none.

why can’t it create this table?

Hola, estás intentando crear un campo desde el estudio y te tira ese error? Probaste con una reparación e intentar crearlo denuevo?

Yes I tried mate.
I did a REPAIR on the admin panel a few times and it didn’t work.
I created the table directly in the database in phpMyAdmin.
This is how I solved it.
But whatever the problem is, I’m not sure if it creates another problem.

Thank you very much for answering all my questions.

Well, first I would recommend that you create the modules through the studio, since it is in charge of creating all the relationships between the different tables that SUITECRM manages.
For this reason I think it is not a good idea to create the tables directly there.
When you modify a module and add a field, the cstm table is created automatically and it will be easier for you to continue tweaking it from there. The best thing is to take advantage of these features offered by suiteCRM and abstract us from the internal logic.

Excuse me for the English. I am from a translator.

Unfortunately Studio could not create the table. I had to manually create it myself.
Thank you for your warning.

Did you create it as a module from within module builder first? If not created from within module builder initially (edited in studio after, but can’t go back to module builder once edits are done in studio), then it won’t write out all the back end files/relationships/table creation etc. You should be able to build the module/table in Module builder, do a repair and rebuild and you’ll see the create/alter statements for the tables within the SQL it has you execute.

Hello jkotus,

Thank you for your interest.

I didn’t create module from module builder.

I just wanted to create an area called BRAND in the PRODUCTS section in the studio environment. But it never did.

I searched a lot. When I learned that the custom fields added in the studio were saved in the aos_products_cstm column in the database, I looked. There is no such table in Databse. I created such a table. Then I added the custom field I wanted in studio. Successfully added.

This is the whole thing…

There was no aos_products_cstm table in the database. And suitecrm was unable to create this table. But I was able to write related records to this table after I created it.

Thank you

To make this thread easier to read for other people, would you be able to edit the Title
FROM

  • Database failure. Please refer to suitecrm.log for details. I get this error. I get this error when I want to add custom field in studio section

TO

  • Table aos_products_cstm is missing - prevents me creating Studio custom fields in Products

In terms of the problem on your installation:

  • can you use Studio to create custom fields in modules like Contacts and Accounts (or does that cause a MySQL error too?)
  • have you used PHP to customise Products (is the directory empty for: custom/modules/AOS_Products)
  • is everything else about Products working OK there?
  • is your Suite used every day by users - or is it still in development, and there are no users except you?

Hello DJuser,

You’re right. I couldn’t find where to edit the title of my post. I should have put a simpler label.