1

I have a picklist on my object called Type: New / Pending / Historical

when the Type field is set to: New, then I would like to prevent another picklist field from being edited. This field is called: Graded

I wonder how to best do this. Maybe workflows? I don't think it's possible to lock a field using workflows though. Maybe it's possible using a formula? How can I express locking a field?

Tia.

2
  • Sorry, I made a mistake, in fact the field that I need to lock, i.e. pervent it from further editing, is a picklist.
    – Lily
    Nov 10 '14 at 12:42
  • I've updated my answer with a working example based on Opportunity fields.
    – Girbot
    Nov 10 '14 at 13:05
2

I presume by lock you mean prevent further editing? You can do this with a validation rule. So (pl__c is the api name of your picklist) ISPICKVAL(pl__c,"New") && ISCHANGED(graded__c) would be it if I understand correctly.

I've just checked in a sandbox here ISCHANGED does work with a checkbox field.

(Should have done this as a answer not a comment - which I've deleted)

EDIT: This is a working example based on Opportunity.Type and Opportunity.Stage. You can use ISCHANGED() with a picklist:

ISPICKVAL(Type, "Upsell") 
&& 
ISCHANGED(StageName)

Thinking about this you may also potentially want to look at using field dependencies, but this wouldn't be true security - it would only be enforced in the UI and not in any API interactions:

https://help.salesforce.com/HTViewHelpDoc?id=fields_defining_field_dependencies.htm&language=en_US

2
  • I have used ISCHANGED() on the picklist (sorry, I am not using a checkbox - my mistake), and it does not work. How would I do this using a picklist that should be locked?
    – Lily
    Nov 10 '14 at 12:45
  • Thank you, it works now. I was expecting the field to be greyed out, but I will get an error message when I try to edit, and that's fine. TKS
    – Lily
    Nov 10 '14 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.