How to make Case description readonly after save?

How to make  Cases description readonly in editview after it has been save?

TIA,

Longki Dela Cruz

Parents
  • Roland Cadavos,

    I presume that you only want it to become read-only once it has been populated with something. There are a few ways that you can do this, with each option depending slightly on the version/edition of Sugar you are using and the exact rules that need to be enforced.

    However a base level resolution for this is to create a duplicate description field and make one a calculated field to copy the value of the other. You would then set dependencies so that the initial fields hides when the calculated one is populated with something, and use the same principal on the calculated field. This will make it look as if the field is suddenly becoming read-only, where in fact it is simply swapping the fields over.

    If you are looking for something more than this let me know.

  • Found the very correct solution emailed by Ajay Kumar to me :-) as for the latter after you hover out to the field it will be automatically set to readonly even if you havent saved it yet. Here's the fix.

    QOUTE from Ajay:

    Hi Longki,

    Good day too!

    1.You can make certain fields readonly by writing dependency.

    2.If you want to make it fields to be readonly only specific views, you can try below.

    Extend "buildGridsFromPanelsMetadata" this method to custom,and push your fields into this.noEditFields variable,this is how sugar is making fields readonly.

    Below is the code snippet,you can copy this code and make changes according to your condition.I tried in recordview.

    Note:we no need to call this method on initialize.

    _buildGridsFromPanelsMetadata:function(panels){

            var noEditFields = new Array();
            this._super('_buildGridsFromPanelsMetadata',[panels]);
            noEditFields.push('phone_alternate');
            this.noEditFields=noEditFields;
        },

    Thanks & Regards

    AjayKumar B

    HTH,

    Longki Dela Cruz

Reply
  • Found the very correct solution emailed by Ajay Kumar to me :-) as for the latter after you hover out to the field it will be automatically set to readonly even if you havent saved it yet. Here's the fix.

    QOUTE from Ajay:

    Hi Longki,

    Good day too!

    1.You can make certain fields readonly by writing dependency.

    2.If you want to make it fields to be readonly only specific views, you can try below.

    Extend "buildGridsFromPanelsMetadata" this method to custom,and push your fields into this.noEditFields variable,this is how sugar is making fields readonly.

    Below is the code snippet,you can copy this code and make changes according to your condition.I tried in recordview.

    Note:we no need to call this method on initialize.

    _buildGridsFromPanelsMetadata:function(panels){

            var noEditFields = new Array();
            this._super('_buildGridsFromPanelsMetadata',[panels]);
            noEditFields.push('phone_alternate');
            this.noEditFields=noEditFields;
        },

    Thanks & Regards

    AjayKumar B

    HTH,

    Longki Dela Cruz

Children
No Data