1 .How to make the fields of case module read only?
2.How to disable create and select button ?
1 .How to make the fields of case module read only?
2.How to disable create and select button ?
You can learn to do this all the "right" way in Sugar config files, array defs, studio settings etc. Or you can "just do it" in javascript.
The javascript method has the added advantage that you can make some fields read-only based on the content of other fields on the same page.
The disadvantage is that you have to add this javascript to every form that offers a chance to edit the field. Plus you have to learn how to insert javascript into the sugar edit forms, which in itself requires learning a little about sugar config files, vardefs etc.
Code:/* * Find an object by its Id, and hide it by setting .display = 'none' */ function elem_hide(id) { var obj = document.getElementById(id); if (obj != null) { obj.style.display = 'none'; } return obj; } /* * Make a form element read-only and gray it out */ function elem_makeReadOnly(id) { var obj = document.getElementById(id); if (obj != null) { obj.readOnly = true; obj.style.backgroundColor = "lightgray"; } return obj; }
Dear If you want to field read only than
goto crm=> custom => modules => Cases => metadata => editviewdefs.php
in this if you want description read only than include js file
'includes' =>
array (
0 =>
array (
'file' => 'readonly.js',
),
),
'javascript' => '<script type="text/javascript"> onload=display();</script>',
),
'panels' =>
readonly.js===========>
function display()
{
document.getElementById('description').disabled=tr ue;
}
hi,
you can put readonly.js into sugarcrm main directoy
e.g.: c://wamp/www/sugarcrm/readonly.js
Hi Nilanjan,
Its so easy to make a field readonly.
Suppose I want to make the name field as readonly then follow this,
'customCode' => '<input type="text" title="" value="" maxlength="150" size="30" id="name" name="name" readonly="true">',
Paste this items to the eidtviewdefs to your module, like
custom/modules/Accounts/metadata/editviewdefs.php and paste the above custom code to your field(as mine is name field) as per your requirement and change the id and name accordingly.
Thanks & Regards
Sumit Sahay
sumit143sweta@gmail.com
The disadvantage is that you have to add this javascript to every form that offers a chance to edit the field. Plus you have to learn how to insert javascript into the sugar edit forms, which in itself requires learning a little about sugar config files, vardefs etc.
how to make readonly field according to the user/team members login.. ??? i have installed security suite for teams and iam using sugarcrm 6.5CE
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks