Make File Upload Required - Custom Module

I created a custom module with module builder that is based on the documents module.  However, I cannot figure out how to make the FILE field required for creation of the record.  When I go to the Vardefs folder for the module, I do not see a php file that corresponds to this particular field.  Also, in studio, the field is not accessible.  See attached screen shot.

  • Hi Matthew Munger 

    If you really created that module from template file then the upload file should be required for sure, take a look at the field def in the vardefs.php of template file (include/SugarObjects/templates/file/vardefs.php):

    'document_name' =>
       array (
       'name' => 'document_name',
       'vname' => 'LBL_NAME',
       'type' => 'name',
       'dbType' => 'varchar',
       'len' => '255',
       'unified_search' => true,
       'duplicate_on_record_copy' => 'always',
       'full_text_search' => array(
          'enabled' => true,
          'searchable' => true,
          'boost' => 0.82,


    André Lopes
    Lampada Global
    Skype: andre.lampada