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!
February 25th, 2009 at 6:31 pm
I would extend the functionality by using a LOV to find if the view is Read only or not.
but in the end i would take into acount that using that kind of script too much can be detrimental.
it could placed in the applet if there are too much applets wit that functionality.
just my 2 cents.
March 3rd, 2009 at 12:00 pm
Want to populate field value into read only field.
Req:- Based on user responsibility I want made field read-only or editable.
I). If user having “xyz Responsibility”, in service request detail applet ‘State field’ should be editable, for all other responsibilities State field should be read only.
II). When the state field read-only for other responsibilities I want to populate a value into State field.
I done the 1st part of the requirement. How to achieve IInd part of the requirement. I appreciated for your response.
March 3rd, 2009 at 10:58 pm
Do u mean predefault a value in state field? if so create a calculated field and use this field in predefault value.
March 19th, 2009 at 11:35 am
Hi Sridhar ,
if i want to disable the buttons like new and delete on application level for a particular responsibility, how i can do this .
Regards
March 19th, 2009 at 6:18 pm
Hi Kiran,
As there is M:M relation ship between Responsibility and an User it will be hard to check this without Scripting.
I would recommend using profile attributes and using that under BC Events. Let me know if you find a better way of doing it.
May 31st, 2009 at 6:49 am
thanks for you
July 2nd, 2009 at 6:41 am
Hi,
There are 2 controls -(fields) on applet level which are showing as read only though the Read Only property is not clicked.
I have also checked at the BC level and there also the Read Only property is not clicked.These two fields are based on an Implicit join.
I have to make those fields editiable on the applet level..kindly advise
Nishant
July 2nd, 2009 at 5:15 pm
Did you check the BC Field User Properties? check and let me know.
July 21st, 2009 at 3:06 pm
Hi Sridhar,
I couldn’t get how this requirement could be done by using using Personalization Views. From my understanding Personalization views can be used to conditionally make a particular view visible to a user or not. How can it be used to determine if a particular field will be available in read only mode in a view or not?
Also why din’t we simply copy the original applet and make a new applet with Status field as read only and base our Opportunity List Admin View on that new applet.
July 22nd, 2009 at 5:12 am
for your first question you are correct. that was my oversight. dont know what I was thinking.
for the second one yes it is doable your way. depends upon requirement. this is just giving you an example. just giving an example. Instead of Active View Name we could use position using this example.
Regards,
Sridhar
July 30th, 2009 at 10:44 am
I have a scenario in which:
There are 2 mvf on a view.
The two mvf(Field 1 and field 2-on Action BC) point to the same MVG Applet(on different BC-x)
there is a link between Action/x.
Problem is when we try and set any value in Field 1,it also gets set to field2(since both are on same BC and uses the same link)
Our scenario is that when field 1 is set to a value,then field 2 should not be populated with the same value,and we should be able to populate Field 2 by again clicking on the MVG applet and selecting a new record.
Technically speaking i know its not possible:(,but can there be a way this could be done.Please suggest.
NB:I tried making a new MVL-didnt work
tried making a new Link-didnt work
tried making a clone of MVG applet for the two fields-didnt work
Please suggest
Thanks
Nishant
July 30th, 2009 at 6:08 pm
Hi Nishant,
I appreciate you participating on this website, but your comment or question has no relevance to this blog post.
Please post your questions in the forums section. You will get better response from everyone over there instead of here.
Thanks,
Sridhar