Custom field with type interval period (like job interval)

Goodmorning,
Is there the possibility to define a custom field for a module, like this?
image

thank you
B.

Hi,
There is no field type like so in the CRM. Instead you can do another thing.
1: Create 2 dropdown fields, 1 for duration value (1,2,3,4,5…) and 2nd for duration type (minutes, hours …)
2: Go to edit view file from “modules/module_name/metadata/editviewdefs.php” and add both fields together there
You can do it if you know programming…
Thanks

thank you for your replay.
what do you mean with this step?

in particular, the last part of the phrase “add both fields toghether there”.
I’m looking editviewdefs.php for Accounts: in my code I have a thing similar this:

array (
0 =>
array (
‘name’ => ‘name’,
‘label’ => ‘LBL_NAME’,
‘displayParams’ =>
array (
‘required’ => true,
),
),
1 =>
array (
‘name’ => ‘phone_office’,
‘label’ => ‘LBL_PHONE_OFFICE’,
),
),

name and phone_office are in the same row, but in two different columns :frowning: How can I put together both?

array (
	0 => array (
		0 => array (
			'name' => 'name',
			'label' => 'LBL_NAME',
			'displayParams' => 
			array (
				'required' => true,
			),
		),
		1 => array (
			'name' => 'phone_office',
			'label' => 'LBL_PHONE_OFFICE',
		),
	),
),

this can be a solution? I don’t know well how can I nested the informations.
thank you,
B.

Take a look at modules/Calls/metadata/editviewdefs.php and look for “name’ => ‘status’”.
You will see something like that:

  array(
    'name' => 'status',
    'fields' =>
    array(
      0 =>
      array(
        'name' => 'direction',
      ),
      1 =>
      array(
        'name' => 'status',
      ),
    ),
  ),

This will let you add two fields in the same cell.
Remember to run Quick Repair and Rebuild after saving the file.

Regards

@andopes, thank you very much for your tip.
In our instance of SuiteCRM, we don’t use this module, so I never seen the layout.

When I’ll finish to create my fields, I’ll try.
B.

Hello, @andopes,
I tried to put fields together, and your solution works. thank you very much.
Just one thing: we have opted to use one integer field (instead dropdown) for the quantity, and a dropdown field for the minutes/seconds etc.

When I put in the single column both fields I have this result:
the integer field uses all width for the column, and the dropdown field appear under the integer field.


How can I set that both field use the 50% of the column?

Thank you for the help,
B.

Can you share the code you updated on editiewdefs?

Of course: this is a piece of code interested:

'panels' => 
array (
 [...]
    'lbl_editview_panel3' => 
        array (
        0 => 
            array (
                0 => 
                    array (
                        'name' => 't_license_retry_freq_qty_c',
                        'fields' => 
                            array (
                                0 => 
                                    array (
                                    'name' => 't_license_retry_freq_qty_c',
                                    ),
                                1 => 
                                    array (
                                        'name' => 't_license_retry_freq_unit_c',
                                    ),
                            ),
                    ),
                1 => '',
            ),
        1 => 
            array (
                0 => '',
                1 => '',
        ), 
    ), // end array for lbl_editview_panel3
), //end panels

t_license_retry_freq_qty_c is the textfield
t_license_retry_freq_unit_c is the dropdown field

Perhaps the integer field is too long!
Try to add this attribute into integer field definition on editviewdefs.php:

        'displayParams' =>
        array(
          'size' => 10,
        ),

Remember to Quick Repair and Rebuild

Thank you for reply, but unfortunately it doesn’t works :worried:

In studio, I configured the maximum size of field to 10 and my editviewdefs.php so:

array (
      0 => 
      array (
        'name' => 't_license_retry_freq_qty_c',
        'fields' => 
        array (
          0 => 
          array (
            'name' => 't_license_retry_freq_qty_c',
			'displayParams' =>
				array(
				  'size' => 10,
				),
			
          ),
          1 => 
          array (
            'name' => 't_license_retry_freq_unit_c',
          ),
        ),
      ),

and QRR made

B.

@andopes thankyou so much for your help.
I resolve the second question (width of input field) using javascript.
I needed to hide and shows this fields based on values of a checkbox and than I used javascript and in the same moment I modify the width of the input field,
thank you,
B.