This is a very common requirement that Siebel Developer stumble upon. The requirement is to make the field read only based on the view so that the people who are assigned to this view using responsibilities are given read or write access.
Example Requirement: Make the field “Status” readonly for the view “Opportunity List Admin View” but all other views should have this field non-readonly.
Without wasting more time here are the steps to achieve this:
- In Siebel Tools select the Application in the object explorer.
- Select the Application you are using. For Example: Siebel Field Service
- Right Click and Edit Server Scripts
- Under Application_PreNavigate event set the profile attribute. Look at the code below. ActiveViewName is the profile attribute that is being set. The code will look something like this.
function Application_PreNavigate (DestViewName, DestBusObjName)
{
this.SetProfileAttr(”ActiveViewName”, DestViewName);
return (ContinueOperation);
}
Many people have an argument that it might not be a good idea to define it under the application and instead define this attribute under the View, but I think that it is better to have at the application level as I don’t have to define for multiple views and I can reference it from anywhere. Small scripts won’t affect anything.
- Create a calculated field under the BC.
- Field Name: CalcReadOnlyFlag
- Calculated Value: IIf (GetProfileAttr(”ActiveViewName”) = “Opportunity List Admin View”, “Y”,”N”) where “Opportunity List Admin View” is the name of the view for which you want to make readonly.
- Field Name: CalcReadOnlyFlag
- Create a BC user property
- Name: Field Read Only Field: Status (Name of the field for which you want Read Only)
- Value: CalcReadOnlyFlag (This is the calculated field that you created above)
- Name: Field Read Only Field: Status (Name of the field for which you want Read Only)
Compile and Test. It is as easy as mentioned above. Until my next post take care and have fun.
Related posts(Auto Generated):





August 7th, 2008 at 7:41 am
Hi,
Nice post. This is something we have tried in the past. But the drawback is that the view name is harcoded into the calculated field. We had a lot of such requirements, so we took care of it using personalization. Now, we only need to add the view names there and there is no need of a srf compile
August 7th, 2008 at 4:51 pm
Hi Ranjith,
If I understand your comment correctly, you defined a conditional expression for views under Admin-Personalization. I totally agree with you. Though I been to these views, somehow it never occurred to me doing it this way. Thanks for this GREAT Tip!