function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunny GSunny G 

How to make a text field purely read only.

Hi,

 

I have text field on the page. And i want the user should not be able to enter anything in this field. Because the value for this field is coming from a trigger.

 

How to make the text field completely read only.

SurekaSureka

Hi,

 

You can make a feild Read Only by Making the feild Read Only at the Page Layout(but still the value can be populated during Data Load) or Edit the corresponding field and check the "Read Only" checkbox(This will not allow even during the data load).

 

Hope this helps.

 

Thanks

Sunny GSunny G

Hi,

 

Thanks for reply..

 

I have the following trigger:

 

trigger initialstage on Pre_Sales_Request__c (befo​re insert, before update) 
{
    for(Pre_Sales_Request__c a:Trigger.new)
        {
            if(a.Previous_Stage__c == null)
            {        
                  
                     a.Previous_Stage__c = a.stage​__c;        
             }     
                          
        }
}

 

 

Where: stage__c is formula text field & 

Previous_Stage__c ia a text fields

 

This trigger i have written to capture the whatever the first value i'll in stage__c field.

 

Now, i want that the Previous_Stage__c field should not be editable at the user level at any how.

 

 

I have also tried using Previous_Stage__c as a formula text field but i am not able to update that field and trigger is giving me an error. something like this field is not writable....

 

please have a look at it..

 

Sunny GSunny G

Hi Sureka,

 

I have tried what you have suggested. But the concern is that the page is getting saved for the end user even, with his own value. We need that field completely non editable for the user.

Jay Kumar PatilJay Kumar Patil
Revoke privilages