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
  • If you create such a button in studio you get the full vardef description in cache/modules/MODULE/MODULEvardefs.php. As an example I created  button in Accounts which results in the following vardef code:

        'button1_c' => 
        array (
          'labelValue' => 'Button1',
          'required' => false,
          'readonly' => true,
          'source' => 'non-db',
          'name' => 'button1_c',
          'vname' => 'LBL_BUTTON1',
          'type' => 'actionbutton',
          'massupdate' => false,
          'hidemassupdate' => false,
          'no_default' => false,
          'comments' => 'Comment for Button 1',
          'help' => 'Help for Button 1',
          'importable' => 'true',
          'duplicate_merge' => 'enabled',
          'duplicate_merge_dom_value' => 1,
          'audited' => false,
          'reportable' => true,
          'unified_search' => false,
          'merge_filter' => 'disabled',
          'pii' => false,
          'calculated' => false,
          'size' => 50,
          'studio' => 
          array (
            'editField' => true,
            'recordview' => true,
            'previewview' => true,
            'recorddashletview' => true,
            'listview' => false,
            'wirelesseditview' => true,
            'wirelesslistview' => false,
            'wirelessdetailview' => true,
            'wireless_basic_search' => false,
            'wireless_advanced_search' => false,
          ),
          'dbType' => 'text',
          'options' => '{"settings":{"type":"YnV0dG9u","size":"ZGVmYXVsdA==","showFieldLabel":false,"showInRecordHeader":false,"hideOnEdit":false},"actionMenu":{"orderNumber":1,"listView":true,"recordView":false,"recordViewDashlet":false,"subpanels":true},"buttons":{"0cbbfd0d-7cd1-419b-ac83-1d23b4f40aff":{"active":true,"buttonId":"MGNiYmZkMGQtN2NkMS00MTliLWFjODMtMWQyM2I0ZjQwYWZm","orderNumber":0,"properties":{"label":"Q1JFQVRF","description":"VG9vbHRpcCB0ZWN0","showLabel":true,"showIcon":true,"colorScheme":"cHJpbWFyeQ==","icon":"c2ljb24tZm9sZGVyLW9wZW4=","isDependent":false,"stopOnError":false,"formula":""},"actions":{"7ab2e8b4-eb24-48bf-a751-354025647579":{"actionType":"Y3JlYXRlLXJlY29yZA==","orderNumber":0,"properties":{"attributes":{},"parentAttributes":{},"module":"QWNjb3VudHM=","link":"","mustLinkRecord":false,"copyFromParent":true,"autoCreate":false}}}}}}',
          'id' => 'e648add0-4b3f-11ee-a848-54ee7593936c',
          'custom_module' => 'Accounts',
        ),

    Most complicated part is the options field which is generated by the QR&R from the DB definition.

    In a development environment you have access to the cache folder and you can extract this definition form the vardef file to include it in custom/Extension/modules/MODULEs/Ext/Vardefs/ folder and by this in GIT. 

Reply
  • If you create such a button in studio you get the full vardef description in cache/modules/MODULE/MODULEvardefs.php. As an example I created  button in Accounts which results in the following vardef code:

        'button1_c' => 
        array (
          'labelValue' => 'Button1',
          'required' => false,
          'readonly' => true,
          'source' => 'non-db',
          'name' => 'button1_c',
          'vname' => 'LBL_BUTTON1',
          'type' => 'actionbutton',
          'massupdate' => false,
          'hidemassupdate' => false,
          'no_default' => false,
          'comments' => 'Comment for Button 1',
          'help' => 'Help for Button 1',
          'importable' => 'true',
          'duplicate_merge' => 'enabled',
          'duplicate_merge_dom_value' => 1,
          'audited' => false,
          'reportable' => true,
          'unified_search' => false,
          'merge_filter' => 'disabled',
          'pii' => false,
          'calculated' => false,
          'size' => 50,
          'studio' => 
          array (
            'editField' => true,
            'recordview' => true,
            'previewview' => true,
            'recorddashletview' => true,
            'listview' => false,
            'wirelesseditview' => true,
            'wirelesslistview' => false,
            'wirelessdetailview' => true,
            'wireless_basic_search' => false,
            'wireless_advanced_search' => false,
          ),
          'dbType' => 'text',
          'options' => '{"settings":{"type":"YnV0dG9u","size":"ZGVmYXVsdA==","showFieldLabel":false,"showInRecordHeader":false,"hideOnEdit":false},"actionMenu":{"orderNumber":1,"listView":true,"recordView":false,"recordViewDashlet":false,"subpanels":true},"buttons":{"0cbbfd0d-7cd1-419b-ac83-1d23b4f40aff":{"active":true,"buttonId":"MGNiYmZkMGQtN2NkMS00MTliLWFjODMtMWQyM2I0ZjQwYWZm","orderNumber":0,"properties":{"label":"Q1JFQVRF","description":"VG9vbHRpcCB0ZWN0","showLabel":true,"showIcon":true,"colorScheme":"cHJpbWFyeQ==","icon":"c2ljb24tZm9sZGVyLW9wZW4=","isDependent":false,"stopOnError":false,"formula":""},"actions":{"7ab2e8b4-eb24-48bf-a751-354025647579":{"actionType":"Y3JlYXRlLXJlY29yZA==","orderNumber":0,"properties":{"attributes":{},"parentAttributes":{},"module":"QWNjb3VudHM=","link":"","mustLinkRecord":false,"copyFromParent":true,"autoCreate":false}}}}}}',
          'id' => 'e648add0-4b3f-11ee-a848-54ee7593936c',
          'custom_module' => 'Accounts',
        ),

    Most complicated part is the options field which is generated by the QR&R from the DB definition.

    In a development environment you have access to the cache folder and you can extract this definition form the vardef file to include it in custom/Extension/modules/MODULEs/Ext/Vardefs/ folder and by this in GIT. 

Children
No Data