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.
- A string which is to searched.
- 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


(9 votes, average: 4.22 out of 5)





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?
Yes you can even use Calculated field and User Property to implement the above requirement..!!
–Kavi
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
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
Hi,
Its really useful to us.
Regards,
Sri…
yes,its very nice solution.
How to test if it is working for that particular responsibility?
Thanks Kavi…it was quite informative..
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
Are InList() and GetProfileAttrAsList() vanilla functions or some customized methods? I couldn't find them any where in Tools help..Pls reply and help