Where does SuiteCRM store custom field definitions?

Hi everyone!

I have added a new field to Accounts but the only place where I can find its definition (field type etc) is inside

cache/modules/Accounts/Accountvardefs.php

, is this correct?
I thought you could wipe the cache directory without problems, and SuiteCRM would rebuild it as needed…

Maybe it looks at the database itself for the field definitions?

The cache folder is not safe to delete, at least not all of it. There are pages online discussing this.

I know for sure that cache/themes is safe to delete.

Have you looked in
modules/Accounts/Accountvardefs.php
custom/modules/Accounts/Accountvardefs.php

The actual construction of the custom fields depends on a few things, this is all documented in the Vardefs and Extension Framework chapters in the Docs.

There is also a database table called fields_meta_data, but normally you don’t go there, you just edit the Vardefs and run a Quick Repair and Rebuild, then scroll to the bottom and it provides a button to edit the tables for you.

1 Like

That’s quite counter-intuitive, but good to know, thanks :smiley:

I have neither, maybe Studio just updates fields_meta_data and cache/modules/Accounts/Accountvardefs.php is generated from it :huh:

It’s probably coming from

modules/Accounts/vardefs.php

Check this post if you’re curious about checking what files are being made from which

https://pgorod.github.io/Audit-File-Accesses/

Nice trick, thanks! :smiley:

Oha. I had no problems with deleting things in the cache folder for now.
Do you have any example or a link to a discussion about that?

I believe this was the article that I had read a long time ago about this:

https://academe.co.uk/2012/06/sugarcrm-cache-directory-it-is-not-a-cache-directory/

But if your experience is that it is safe to delete, I take that as evidence :slight_smile:

And I suppose that some of these things have changed since the SugarCRM days… for example, “cache/upload” is now “upload”, and everybody knows it shouldn’t be deleted (well - only some parts).

I confirm this: cache/modules/vardefs.php may be removed, SuiteCRM will rebuild it with data from the fields_meta_data table.

1 Like