Add a custom field to Workflow module

Hi,

I am trying to add custom fields in the workflow module. My aim is to add additional information into workflows (such as a type, a company branch), so that later, my administrators can find and update these workflows easily.

The workflow module does not appear in studio, so I tried creating the custom fields manually.
So far, I have managed to add the field in the view, and to define its caption. But I Don’t know how to override the module’s vardef definition, so my field has no type and can’t be used.

Can anyone help me out with that ?

Thanks a lot !

Update : I realized that my customisation of the module had broken something. The “add condition” and “add action” butons do not work anymore.
Well, they Don’t work on EditView, when there is no condition yet created. Meaning when I’m Editing a workflow that already has conditions and actions, I can add more, but when I’m creating a workflow from blank, I can’t add the first one.

I tried to delete every customisation I had made on the module, but it still doesn’t work.

Would anyone know what I could have done to cause that ?

I really need this module to work :cry:

Try a few rebuilds from the Admin / Repair page.

QR&R, Javascript stuff, relationships etc.

If that doesn’t solve it, have a look at your logs and at the browser’s developer console, there should be some signs of what’s breaking

Ok so I tried running every repair possible, but it didn’t change anything.
My logs Don’t show anything unusual.

When I look at the HTML page, there seems to be an action on the buttons, but they appear black and smaller, and nothing happens when I click on them.


Can you check Console Panel (press F12 and a small section will pop ) for any JS errors?
Have you set your error display in php.ini to Off?

It was indeed set to off, but I changed it and there are still no errors displayed.
I can give you what it shows, but I doubt it will be of any help. (Sorry it’s in french, I Don’t know how to change that).

Continuing the discussion from Add a custom field to Workflow module:

Ok, so I reperformed a QR&R, and now it seems to work…
Don’t know what changed since yesterday…
Anyway, thanks for your help :smile:

module/aow_workflow/vardef.php (add in fields array for different data type and do repair and rebuild)

 //for relate eg for lead
    'fields'=>array(
    'lead_id' =>
      array(
        'required' => false,
        'name' => 'lead_id',
        'vname' => 'LBL_CM_SLA_ID',
        'type' => 'id',
        'massupdate' => 0,
        'comments' => '',
        'help' => '',
        'importable' => 'true',
        'duplicate_merge' => 'disabled',
        'duplicate_merge_dom_value' => 0,
        'audited' => false,
        'reportable' => false,
        'unified_search' => false,
        'merge_filter' => 'disabled',
        'len' => 36,
        'size' => '20',
      ),
      'lead' =>
      array(
        'required' => false,
        'source' => 'non-db',
        'name' => 'lead',
        'vname' => 'LBL_CM_SLA',
        'type' => 'relate',
        'massupdate' => 0,
        'comments' => '',
        'help' => '',
        'importable' => 'true',
        'duplicate_merge' => 'disabled',
        'duplicate_merge_dom_value' => '0',
        'audited' => false,
        'reportable' => true,
        'unified_search' => false,
        'merge_filter' => 'disabled',
        'len' => '255',
        'size' => '20',
        'id_name' => 'lead_id',
        'ext2' => 'Leads',
        'module' => 'CM_SLA',
        'rname' => 'name',
        'quicksearch' => 'enabled',
        'studio' => 'visible',
      ),

    // for varchar

    'run_when' =>  array(
        'name' => 'run_when',
        'type' => 'varchar',
        'vname' => 'LBL_RUN_WHEN',
        'default' => '',
      ),

    // for flex relate
          'parent_type' =>
      array(
          'name' => 'parent_type',
          'vname' => 'LBL_PARENT_TYPE',
          'type' => 'parent_type',
          'dbType' => 'varchar',
          'required' => false,
          'group' => 'parent_name',
          'options' => 'parent_type_display',
          'len' => 255,
          'comment' => 'The Sugar object to which the call is related'
      ),

    'parent_name' =>
      array(
          'name' => 'parent_name',
          'parent_type' => 'record_type_display',
          'type_name' => 'parent_type',
          'id_name' => 'parent_id',
          'vname' => 'LBL_LIST_RELATED_TO',
          'type' => 'parent',
          'group' => 'parent_name',
          'source' => 'non-db',
          'options' => 'parent_type_display',
      ),
    'parent_id' =>

      array(
          'name' => 'parent_id',
          'vname' => 'LBL_LIST_RELATED_TO_ID',
          'type' => 'id',
          'group' => 'parent_name',
          'reportable' => false,
          'comment' => 'The ID of the parent Sugar object identified by parent_type'
           ),

    // for date

        'sla_breach_date' =>
      array(
        'name' => 'sla_breach_date',
        'vname' => 'LBL_BREACH_DATE',
        'type' => 'datetime',
        'required'=> true,
        'inline_edit' => 0,
       ),
      ),