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

Make amount field read only on opportunity whenever an opportunity stage is closed won.



     How can i do that can any body explain?


Validation rule:


AND(IsWon, NOT( Amount = PRIORVALUE( Amount )))

No need to write any actual code.



I want to make it Amount field as a read only , but i'm able edit the amount field.


To make the field actually read-only would require an entirely new Visualforce page. Simply using a validation rule will leave the field as editable on the edit page, but any changes to the field will render an error message and not allow the successful save of the opportunity.