Default values not working

Hi,

I am using SugarCRM version 7.5.2.3. I have set default value for a 'date' field as 'today'. But the field still shows only blank space. I have tried 'Quick repair and rebuild', cleared browser cache etc. But the issue still there. I have also tried to set default value for some other type fields, they too, didnt work. Somebody help me. Suggest some solution either through Studio or by editing php code.

Thanks in advance.

- Sudeep

Parents
  • Hi Sudeep,

    can you try setting default value through vardefs.

    Here is an sample code for test_date field for opportunities module.

    /custom/Extension/modules/Opportunities/Ext/Vardefs/sugarfield_test_date.php

    $dictionary['Opportunity']['fields']['test_date']['display_default']='now';
    

    The same can you try for case.Then make a repair and rebuild.Hope you will be checking this for new record.

Reply
  • Hi Sudeep,

    can you try setting default value through vardefs.

    Here is an sample code for test_date field for opportunities module.

    /custom/Extension/modules/Opportunities/Ext/Vardefs/sugarfield_test_date.php

    $dictionary['Opportunity']['fields']['test_date']['display_default']='now';
    

    The same can you try for case.Then make a repair and rebuild.Hope you will be checking this for new record.

Children
  • Hi Ajay

    Thank you for your response. It worked for me in creating a record. But I need this while updating a record. What I am trying to do is to add a date field which will take todays date if the user didnt manually entered a date to that field. If I could fill the date field with current date while editing, it would get stored if the user didnt manually enter a date. Can you help me in this?

    regards,

    -Sudeep