Requirement:

If the user that has logged in is SADMIN then and he goes to Administration – Data > List of Values view then he should only be able to see LOV’s with Type as SR_STATUS.

My Thoughts:

This is a really strange requirement as SADMIN is suppose to have access to all the Admin views . If this requirement was to restrict some particular user then it would make sense functionally.

Now imagine that a particular person is responsible for managing SR Status LOV’s and if we give him access to all the LOV’s then it might confuse him and also he might change something which might affect other functionalities. So, it makes sense to give him only access to LOV’s of Type SR_STATUS so that he doesn’t change anything else accidentally or intentionally.

Solution:
Now, not going into detilas of Pro’s and Con’s of this requirement we will jump on to the Solution of this requirement.As always there are 2 ways to do things in Siebel

Scripting Solution:

On the Server Script of List of Values List Applet write the code given below in WebApplet_Load event.


if(TheApplication().GetProfileAttr('Me.Login Name') == "SADMIN")
{
var BC = this.BusComp();
BC.ClearToQuery();
BC.SetViewMode(3);
BC.SetNamedSearch("LOVType","[Type] = ‘SR_STATUS’”);
BC.ExecuteQuery();
}

If you notice in the code I have used SetNamedSearch method because I don’t want user to see any other values. If I would use SetSearchSpec or SetSearchExpr then user can override it by issuing a blank query from UI, but it is not possible with SetNamedSearch. To know more details about SetNamedSearch please read the following post.

But why go for scripting when you can do it without scripting.

Solution without Scripting:

You can use personalization in this situation:

  • Goto Administration – Personalization > Rule Sets
  • Create a New Rule Set with following details
    Name: List of Values
  • In the Rules List Applet Click New and provide following details
    Name: Restrict LOV
    Rule Type: Expression
    Sequence: 1
  • In More Info form applet provide the following details
    Conditional Expression: GetProfileAttr(’Me.Login Name’) = ‘SADMIN’
    Include Expression: [Type] = ‘SR_STATUS’
  • Now go to Administration – Personalization > Applets
  • In the List Applet create a New Record
    Select “List of Values List Applet” from the Name Pick Applet
  • In the Rule Set List Applet below it Click on New
  • Select the ‘List of Values’ Rule Set that you created Previously in 2nd Step
  • Give the Sequence as 1

And you are done… Just log off and login and go to Administration – Data > List of Values and you should only be seeing the values only of Type = SR_STATUS.

Hope this helps.

OkAvarageGoodVery GoodExcellent (7 votes, average: 3.57 out of 5)
Loading ... Loading ...