restrict editview in a sidecar module under certain conditions

Hi,

I have a field in accounts module, when this field change to "Closed" status, i need to allow the editview's record only for the assigned user, and restrict to the other users. How can i do that without roles in SugarCRM 7.6?

Thanks for your help.

Parents Reply Children
  • Oscar,

    I tested this and was actually able to get it to work without needing the Dynamic Record View. I created the below file, ran a Quick Repair, and it worked as expected. Let me know if you have any questions about getting it to work!

    // custom/modules/Accounts/clients/base/views/record/record.js
    ({
        extendsFrom:'RecordView',
        initialize:function(options){
            this.plugins=_.union(this.plugins||[],['HistoricalSummary']);
            this._super('initialize',[options]);
        },
        _buildGridsFromPanelsMetadata:function(panels){
            var noEditFields = new Array();
            this._super('_buildGridsFromPanelsMetadata',[panels]);
            if(this.model.get('status_c') == 'Closed') {
                for(field in this.model.fields) {
                    noEditFields.push(field);
                }
                this.noEditFields=noEditFields;
            }
        },
    })
    

    -Alan

  • Hello Alan,

    This development can work for mobile app ?

    If I want to achive this then how can ?