You need to sign in to do that
Don't have an account?
QuickDEV
New field on page layout
Hi,
I have a requirement to create a custom field with some restriction.
The requirement is, the user should be able to delete the existing text in the filed but should not be able to enter new text into it. To save new value in the field the user has to go to another visualforce page and select the data which satisfies few requirements.
How can I achive this? Any focus on using validation rules or trigger etc?
Thanks in advance.
Would this work as a validation rule on the field?
AND(ISCHANGED(yourField), yourField<> null)
Partial deletion of text is one of the scenarios.
It is something like this, they choose some values from the visualforce page which in turn stored in this field.
If they think that one of the values is not the right one and may want to delete it.
I am not sure how I would do that with a validation rule ...sorry. I would probably write a trigger to handle it, and just compare the initial string with what they have edited and if newString.length() > oldstring.length() and also do a text comparison - then throw an error. Probably not the cleanest way to do it, but its the best I can think of sorry.