Join Fribiz, place bids and win prizes | Next Tip »Home

InList and GetProfileAttrAsList functions

OkAvarageGoodVery GoodExcellent (9 votes, average: 4.22 out of 5)
Loading ... Loading ...

 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

Related Posts


Article by neel

Authors bio is coming up shortly. neel tagged this post with: Read 416 articles by neel
View Comments Post a Comment
  1. Franklin Hooboo says:

    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. Kavitha Devarajan says:

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

    –Kavi

  3. Ayoub says:

    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

  4. Pankaj Singh says:

    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

  5. Sridhar says:

    Hi,

    Its really useful to us.

    Regards,
    Sri…

  6. ram says:

    yes,its very nice solution.

  7. shreyakesh says:

    How to test if it is working for that particular responsibility?

  8. SK says:

    Thanks Kavi…it was quite informative..

  9. Hanu says:

    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

  10. Bmeajay says:

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

blog comments powered by Disqus

Polls

Do you know how to use replace function?

View Results

Loading ... Loading ...