I am trying to establish if it is possible to make a field read-only until a value within a pick list is chosen. Basically we have a pick list called structure and if the field value called "Aligned" is selected then I want the text field called Aligned Name to be available for import all other times this field should not be available.
Has anyone done anything similar? I'm guessing that this could only be achieved through WF but I haven't been able to find any code to make fields read only.
I am trying to perform this function on the Account screen. Dynamic layouts would solve the issue with this one as it cannot tie back to the Account type record. Thanks for the suggestion though.
Hi, Work flows/ Advanced field management can be used to enforce checks but i don't think they can help to make a field read-only / editable depending on other fields. Would be great to have this if someone has interesting suggestion on this
-- Venky CRMIT
Support have come back with the following which i wasnt aware could be done.
When using a CRM On Demand workflow, how do I make a field required upon population of another one? (Doc ID 743664.1)
They are now going to look to see if they can change the code to do the opposite.
For those of you unable to download the document from MetaLink3 here it is:
As an example to illustrate this requirement, let’s say that once there is a checkbox field called "My_Check_Box". When this field is checked, the "Account Type" field need to become a required for entry by the user. To do this follow these steps:
1. In the Admin> Application Customization, select the appropriate Object and go into the Object Field Setup.
2. Edit the field called "My_Check_Box" and enter a Field Validation expression so it uses the following expression:
=[<bMy_Check_Box_ITAG>] AND NOT([<AccountType>] IS NULL AND [<bMy_Check_Box_ITAG >]='Y')
3. Enter an explicit error message.
This expression means that when the checkbox field is checked, the Account Type becomes required. Your custom error message will be raised when checking the checkbox, leaving the account type unpopulated and trying to save the account record.
4. Edit the Account Type field and enter the following expression as Field Validation:
=[<AccountType>] AND NOT([<AccountType>] IS NULL AND [<bMy_Check_Box_ITAG >]='Y')
5. Enter an explicit error message.
That validation handles the user case where a user changes the Account Type value from a NOT NULL value to a NULL value. Your custom error message will be raised when emptying out the account type from a populated value to nothing while the checkbox is checked and trying to save the account record.
Note that the expression in both fields validations begins with the field variable on which the statement is being written.**
So I know this post has been around for a while, however, I have a potential solution that might be useful for people looking to do something similar.
It is similar to the feedback provided by Oracle concerning a field vlaidation, but with a slight change. I was trying to make a picklist value read-only when another picklist value was not null, however, the solution should also be able to be applied to other field types.
Try something similar to: NOT(PRE('<Picklist01_ITAG>') <> [<Picklist01_ITAG>] AND [<Picklist02_ITAG>] IS NOT NULL))
For a text field being read-only it would be something like: NOT(PRE('<Textfield01_ITAG>') <> [<Textfield01_ITAG>] AND [<Picklist_ITAG>] IS NOT NULL))
This essentially means that when Picklist02 is not null, the field that we want to be read only cannot be saved as anything other than what was previously in that field, whether that be a value or blank. It alos allows you to provide an error message explaining why such a change cannot be made.
Hope this helps and/or makes sense for those looking to make this change in the future!
Note: For those trying to use a workflow to enforce this, workflows aren't always desirable because they allow the user to change a value and then it gets removed without providing an explanation - in other words it is frustrating and confusing for the end user. Just something to keep in mind.