Button Field - How to embed the "definition" in a vardef file instead of partial DB storage

Hi Guys,

I have a quick question : do you know how to store in a vardef file the FULL definition of a button field (instead of the current storage when created from the studio with partial storage in DB table) ?

The purpose of this request is to easily deploy custom buttons for our customers and also be able to track the code with GIT.

Many thanks,

Fred

Parents Reply Children
  • Hi  ,

    today we do this that way

    1 ) create a sugarfield_the_name_of_my_button.php in

    custom/Extension/modules/<MODULE_NAME>/Ext/Vardefs

    2) include a basic definition for the field

    <?php
    // this file was created by dotBase the ...
    $dictionary['MODULE_NAME']['fields']['the_name_of_my_button']['name']='the_name_of_my_button';
    $dictionary['MODULE_NAME']['fields']['the_name_of_my_button']['vname']='LBL_THE_NAME_OF_MY_BUTTON';
    $dictionary['MODULE_NAME']['fields']['the_name_of_my_button']['type']='actionbutton';
    $dictionary['MODULE_NAME']['fields']['the_name_of_my_button']['options']='';
    $dictionary['MODULE_NAME']['fields']['the_name_of_my_button']['dbType']='text';

    3) launch a quick repair and run the query to align DB and code

    4) finish the button configuration from studio, so all the settings will be stored inside the sugarfield_xxx instead of fields_metadata

    OF COURSE, we are aware that this field is not seen as a custom field and so created in the main table.

    But this is a most convenient way for us to track code customisation / versionning using GIT, even more with mutliple environnement (DEV, STAGING, PROD etc.).

    Hope it helps,

    Fred