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.

I tried above lines of code for custom checkbox on editview. It is working on it.

But, problem is usually this checkbox gets auto checked when we perform some action. After this change, it is not performing that task.

What is solution? Is there any other way?

In my case, for a Checkbox called, I used CustomCode to make the don_receipt_issued checkbox field conditionally readonly if the value of the don_receipt_num_status text field is not equal to "GeneratedByKCRC

'customCode'=>'{if $fields.don_receipt_num_status.value == "GeneratedByKCRC"}@@FIELD@@{else}<div style=\'visibility:visible\' disabled="true" id="don_receipt_issued" ><input {if $fields.don_receipt_issued.value == "1"} checked {/if} tabindex="0" enabled="false" id="don_receipt_issued" type="checkbox" class="checkbox" value="$fields.don_receipt_issued.value" disabled="true"></div>{/if}',

You can manipulate this code to suit your situation

Yes, it seems like a rather convulted way to do it, but the ReadOnly way had issues as you have discovered.