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
anvesh@force.comanvesh@force.com 

Not to enter value into textbox?

i have a custom field on standard page  'Rating'. this field is  updated based on the other field population... it has a textbox .

 

now i want  this textbox  dont allow anything from user. (because it was populated based on other field)...so how to  disable this textbox.

Devender MDevender M
U can make that field read only.
Avidev9Avidev9

Well is this field on VF page or a Standard Pagelayout ?

 

So if it is on Custom page

  • You can remove the same from layout
  • Mark it readonly
  • Apply a validation rule so that it gives error when user enters something

If VF page

  • Just mark disabled="true"
Satish_SFDCSatish_SFDC
If there are no use cases where the user enters value in the text box you can make the field readonly on the Page layout.
If the value is automatically populated, why not use a formula field and calculate the value.

Or you can use the Validation rules and one of the members suggested.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.