How To Make User Edit field readonly in suitecrm.

Hello, I want make three of the create user edit field readonly in suitecrm. Any Help please.

https://docs.suitecrm.com/admin/administration-panel/roles-and-security-groups/#_role_management

It sais in the manual that you can set edit to “none”, and you could leave view to not set.

thanks buh what i actually wanted was to make some fields non editable and some of them editable.
Like disable the username for no edit buh the rest of the field say firstname and lastname would be edited.
Any help.

did u manage to solve this

Have a look at Dynamic Panels https://store.suitecrm.com/addons/dynamic-panels
You can make fields read-only role based and by criteria.

Ohk thanks. But I actually created some custom code with jquery.

step1 . go to custom/module/<module_name>/metadata/editviewdefs.php or module/<module_name>/metadata/editviewdefs.php

step2. add Property Type ‘type’ => ‘readonly’
‘lbl_editview_panel1’ =>

      array (
        0 => 
        array (
          0 => 
          array (
            'name' => 'unibanx_account_number_c',
            'label' => 'LBL_UNIBANX_ACCOUNT_NUMBER',
            'type' => 'readonly',
          ),
          1 => 
          array (
            'name' => 'currency_c',
            'function' => 'getCurrencyDropDown',
            'label' => 'LBL_CURRENCY',
            'type' => 'readonly',
          ),
        ),

Can you share the jquery code you used to make a field readonly?
I know how to make a field readonly by editing the editviewdefs.php file but doing it that way does not give me the flexibility I need in my current situation

BTW, do NOT use ‘type’ => ‘readonly’, in the editviewdefs file. Doing this will work for a text field but removes formatting from other fields (like Checkbox, Currency, …)

If you want to make a field readonly by editing editviewdefs, use displayParams as follows

          0 =>
          array (
            'name' => 'field_name',
            'label' => 'LBL_FIELD_NAME',
           ' displayParams' => array(
                'readonly' => true,
            )
          ),

Doing it this way allows the field to maintain the formatting intended for that field type.