InList and GetProfileAttrAsList functions

 This is a very useful tip shared with us by “Kavitha Devarajan” known as “Kavi” to us.

==================================================================

Requirement:

Disable the Button if user has ‘Junior Sales Representatives’ responsibility assigned to him.

Thoughts/Assumptions:
This requirement is quite different for me, since every time we configure enable and disable button functionalities based on Position Names.

We have a button called as “create Quote” with method name as “CreateQuote” on Quote list applet based on Quote BC. We would like to enable/disable this button conditionally according to above given requirement.

Solution:

  • In Quote BC, create Calculated Field with following details:
    Name: ResponsibilityFound
    Calculated Value:IIf(InList(“Junior Sales Representatives”,GetProfileAttrAsList(“User Responsibilities”))).
  • Write Script on Quote List Applet
    if (MethodName == “CreateQuote” && this.BusComp().GetFieldValue(“ResponsibilityFound “) == “Y” )
       {
         CanInvoke = “FALSE”;
         return( CancelOperation );
       }

Explanation:

In the above expression, ‘User Responsibilities’ is a MVF field in “Personalization Profile” BC. The Link is based on Responsibility/Personalization Profile BCs. This field stores the List of Responsibilities assigned to the user of Siebel Application.

GetProfileAttrAsList(“User Responsibilities”) returns the MVG Value as a comma separated list.

From this list of responsibilities, required Responsibility Name is checked using ‘InList’ function.

InList function accepts 2 arguments.

  1. A string which is to searched.
  2. A comma separated from which the string should be searched.

In our case we are searching for “Junior Sales Representatives” from a comma separated list of responsibilities returned by GetProfileAttrAsList.

Hope this helps…!!
Thanks Kavi

22 Responses to InList and GetProfileAttrAsList functions

  1. Rather than scripting on the Applet you could use the calc field and an Applet User property “CanInvokeMethod: YourMethod” to prevent those users from invoking your button?

  2. Rather than scripting on the Applet you could use the calc field and an Applet User property “CanInvokeMethod: YourMethod” to prevent those users from invoking your button?

  3. Yes you can even use Calculated field and User Property to implement the above requirement..!!

    –Kavi

    • Kavi Thanks for sharing this.

      Can you please suggest, if we would like to use this in child bus comp and need to enable button only for certain responsibility.

      As far as i can see script will be able to fetch value of this field only if there is a record present in chlid buscomp.

      looking forward for reply.

  4. Yes you can even use Calculated field and User Property to implement the above requirement..!!

    –Kavi

  5. Wonderful, I although agree with Franklin, using Applet user property is more elegant. But the function in the calculated field is very smart and useful.

    Thanks

  6. Wonderful, I although agree with Franklin, using Applet user property is more elegant. But the function in the calculated field is very smart and useful.

    Thanks

  7. Nice post actually I was looking for something like this where I can get the responsibility of logged in user and perform certain action based on that. Really helpfull.

    I think the correct expression is :

    IIf(InList(“Junior Sales Representatives”,GetProfileAttrAsList(“User Responsibilities”)),”Y”, “N”)

    Thanks

  8. Nice post actually I was looking for something like this where I can get the responsibility of logged in user and perform certain action based on that. Really helpfull.

    I think the correct expression is :

    IIf(InList(“Junior Sales Representatives”,GetProfileAttrAsList(“User Responsibilities”)),”Y”, “N”)

    Thanks

  9. Nice post actually I was looking for something like this where I can get the responsibility of logged in user and perform certain action based on that. Really helpfull.

    I think the correct expression is :

    IIf(InList(“Junior Sales Representatives”,GetProfileAttrAsList(“User Responsibilities”)),”Y”, “N”)

    Thanks

  10. Hi,

    How to use that calculated expression in the escript? can you give me the sample script and let me know is it works in 7.8 version?

    Thanks,
    Hanu

  11. Are InList() and GetProfileAttrAsList() vanilla functions or some customized methods? I couldn't find them any where in Tools help..Pls reply and help

    • Hi Kavi

      Thanks for providing such a informative topic.

      I have a situation where a button has to be disabled based on positions, without using scripting.

      Any suggestions for above scenario is highly appreciated..

      Thanks in advance

  12. Ravi
    I didn’t find thes functions InList & GetProfileAttrAsList , I am using Siebel 8.1 Sample ..Kindly help me out

Leave a Reply

Contribute