0

I need to lock an account name field, and remove a custom button if the close date is more than 6 weeks from today and the stage is closed won.

I was thinking to use record type and page layout. I created a new record type called 'Lock' and a read only page layout. But my problem is I don't know where to go from here. Is there a workflow I need to create or a validation rule? If so, how do I go about doing this?

And also now when I create an opportunity the custom button disappears, I would say it seems that it is using the read only page layout except for the fact that the account name field remains editable (and this is set to read only in the read only page layout). Any ideas as to why this is happening?

  • Are you viewing that page as the system admin? – martin Aug 11 '15 at 10:02
  • @martin Yes I am – Nik Aug 11 '15 at 10:04
  • 1
    That explains the read-only issue then. The system admin has a permission where they can always edit read-only fields. If you log in as a different user you should see the field is read-only. – martin Aug 11 '15 at 10:07
  • No problem, glad to help. – martin Aug 11 '15 at 10:10
2

Yeah, sounds about right! Go for a workflow that would change your record type, and then make a special page layout for it and then validation rule (if you need one) that would prevent any kind of modifications if your record is of 'locked' record type.

  • Thanks for pointing me in the right direction it's working now! – Nik Aug 11 '15 at 11:12
0

As Kazoolsky said - the workflow rule would be needed to change the layout and remove the button. As for the validation rule, here it is:

AND( (CloseDate - TODAY() > 42), (IsWon = TRUE) )

You could also add in something like ($Profile.Name<>"System Administrator") to allow yourself and other Admins to not have issues if you're doing any sort of data imports or updates on that record.

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.