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.
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)
No comments:
Post a Comment