How to make "Team" field as readOnly on "record view" for all modules ?

Hello Team,

I want to make "Team" field as a readOnly on record view for all modules, so please suggest how I can make it.

Sugar version : 7.7 Ent

Thanks,

Shyam

Parents
  • Hello Shyam,

    I would recommend creating a new Role for this purpose.  You can then change the Field Level Permissions and set the Teams field to Read Only in all modules.  Each Regular User would then be assigned to this Role, to prevent them from modifying the Teams field.

    The System Administrator User would still be able to modify the field, as they are exempt from Role restrictions, but I would consider this a good practice, just in case something is mis-configured with User's Default Teams.  The System Administrator can make the needed change to the Teams that were set incorrectly.

    Regards,

    Dan Kallish

    Advanced Support Engineer

    SUGARCRM

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com

  • Dan Kallish

    Thanks for the reply, you are correct through Field Level Permissions we can set Team field as a ReadOnly.
    My problem is - I want to set for some Administrator users too, I know it's strange thing, but in our CRM process admin level users also part of end user.

    Hence I am looking through code level.

    Thanks,

    Shyam

  • Hi Shyam Gaikwad,

    Try to create record.js in folder <sugar>/custom/clients/base/views/record then put code:

    ({
    extendsFrom:'RecordView',
        initialize:function(options){
           this._super('initialize',[options]);
        },
        _buildGridsFromPanelsMetadata:function(panels){
            var noEditFields = new Array(); // or var noEditFields =[];

            this._super('_buildGridsFromPanelsMetadata',[panels]);
            noEditFields.push('team_name');
            this.noEditFields=noEditFields;
        },
    })

    Do Quick Repair & Rebuild then check once. If unsuccessful, try to duplicate the record.js from <sugar>/jssource/src_files/clients/base/views/record

    then insert the _buildGridsFromPanelsMetadata function then do QRR. Dont forget to tag as Correct Answer if this solves the problem, thanks

    Hope This Helps,

    Roland

Reply
  • Hi Shyam Gaikwad,

    Try to create record.js in folder <sugar>/custom/clients/base/views/record then put code:

    ({
    extendsFrom:'RecordView',
        initialize:function(options){
           this._super('initialize',[options]);
        },
        _buildGridsFromPanelsMetadata:function(panels){
            var noEditFields = new Array(); // or var noEditFields =[];

            this._super('_buildGridsFromPanelsMetadata',[panels]);
            noEditFields.push('team_name');
            this.noEditFields=noEditFields;
        },
    })

    Do Quick Repair & Rebuild then check once. If unsuccessful, try to duplicate the record.js from <sugar>/jssource/src_files/clients/base/views/record

    then insert the _buildGridsFromPanelsMetadata function then do QRR. Dont forget to tag as Correct Answer if this solves the problem, thanks

    Hope This Helps,

    Roland

Children