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
Behzad Bahadori 18Behzad Bahadori 18 

Quote Line Item make SalesPrice field Read Only

Hi is there anyway that I can make the SalesPrice field on Quote Line Item, read only so nobody can override it besides Syestem Administrator. I cant make the field read only by going to the Layout . Maybe  a trigger?
Best Answer chosen by Behzad Bahadori 18
NagendraNagendra (Salesforce Developers) 
Hi Behzad,

Unfortunately, it is not possible to set that field to read only via Field Level Security:
User-added imageAnd it is not possible to remove that field from the Page Layout either. So as a workaround, I'd recommend a validation rule that would prevent users of other profiles from saving a change to this field.  Here is the syntax for that:
AND(
ISCHANGED(UnitPrice),
$User.ProfileId  <> 'ID of Sales Operation Profile'
)
To get the ID of the Sales Operation profile, simply navigate to the Profile itself and then grab the ID from the URL:
User-added image

Please mark this as solved if the information helps so that it gets removed from the unanswered queue and will be available as proper solution for others who are encountering similar issue.

Regards,
Nagendra.