Set default value

I’ve created a simple INT field in Studio and I’ve set the default value to be 1, but going into the module, that field is empty. I tried to insert the default value also via code in:




but it doesn’t work. it’s really annoying because it’s a stupid problem, but it’s necessary, does anyone know how to solve it? Thanks.

SuiteCRM Version 7.10.20
Sugar Version 6.5.25 (Version 344)

Have you run a Quick Repair and Rebuild after the change?

Yes, it’s the first thing I did

I’m suspecting it’s related to file permissions. Make sure they are correct and your web user is included in the config file. Check here for more info:

I am testing it locally and I have given the maximum permissions to the folders (windows system)

(Usas Xampp o el servidor nativo de Windows?) Sorry I meant to ask you if you are using xampp or the native web server of Windows?

A first thing to check is if the QR&R was able to find those changes and pull them into


This is what I use:


$dictionary['test_testModule']['fields']['num1'] = array(
    'value' => 1,

I use xampp.

I can’t find any ‘custom/ext/…’ line.

Your solution works, just what I wanted, the problem though is that it doesn’t allow me to edit it. It sets the field to 1, but if I want to modify it, it doesn’t work, it remains at 1.

My mistake, you’re right, the value attribute is the wrong one to do what you wanted because whatever you enter will just get overridden by the value attribute.

However I tried what you did and used default attribute and it works for me though…

using the default_value attribute, the value ‘1’ appears only in the Edit phase, but not in the detail (as it happens setting ‘value’ in your example)


Here are my results when I use the Default attribute:

In my custom vardefs file:

It shows the default value:

Inserting a different value:

The new value displays on the detailview. I even logged out and closed my browser just to make sure…

I misspoke, I’ll try to be more specific:

  1. I set in


the default value:

$dictionary['<custom_module>']['fields']['<custom_field>']=array('default_value' =>1);

(‘default’ =>1 does not work)

  1. I do Q&R
  2. in Detail of the module in question does not appear any value
  3. I go to Actions->Edit and I see my field set to 1
  4. I modify the field, for example 5 and save
  5. I return to Detail and see the change (before there was nothing, now there is 5, the new value)

Sorry, I meant