I had a requirement wherein i had to make a field Editable only for certain user and read only for others.
the requirement is very easy and can be achieved with configuration.
- Create a Responsibility and Assign it to Users for whom to make Field Editable.
- Create a calculated field on BC with the following expression .
IIf((GetProfileAttr("User Responsibilities") = "Your New Responsibility"),"N","Y")
name this field as ReadOnlyFlag.
- Create a User Property Field Read Only with the following value,
Name :Field Read Only Field: Email Address
Value :ReadOnlyFlag
and you are done now the field Email Address will be editable for users with responsibility Your New Responsibility.
Limitations : The Expression "IIf((GetProfileAttr("User Responsibilities") = "Your New Responsibility"),"N","Y")" get the of users primary responsibility only so you have to make the new responsibility as Primary responsibility of User.
the alternative for this is using another method
GetProfileAttrAsList("User Responsibilities")
and make the calculate field as ,
IIF(InList("Your New Responsibility",GetProfileAttrAsList("User Responsibilities")), "Y", "N")
this method gets the list of user responsibility and the expression above checks if the New Created Responsibility is in this list and based on this check returns Y or N.
Hope this was helpful ...