Christmas is fast approaching and it’s all change here at Ollerenshaw IT!
Our Siebel upgrade project is on hold and I’m back in the development hotseat, doing what we all secretly love doing best – writing code!
Working in Siebel 8 shows just how things have moved on since the old days of Siebel 99, 6 and Siebel 7. Nowadays, we have loads of User Properties at our disposal and there’s less and less of an excuse to write script. Inevitably, however, Oracle haven’t quite thought things through and we have to resort to good old eScript. It’s just the way of things.
This week I came across an annoying oversight. A simple requirement to hide a button on an applet for all but a select Responsibility. Easy peasy, surely? Not so!
A quick search reveals a number of Blog entries, including one from Alex Hansal’s fantastic site, detailing a ‘Hide Control’ user property. Alas, this property is only available on a very small subset of Applet classes and so cannot be used as a ubiquitous solution.
And so we must turn to code and configuration.
Again, there are a number of Blog posts out there that provide this information, but I just wanted to go a little further and provide a full solution with some little hints and tips. Here’s what I did:
- Create a new field in the Personalization Profile BC, to tell us if the user has the appropriate Responsibility
- Now, add some Browser Script on the Applet_Load event to hide the control, based on the the new Profile Attribute:
Name: OLI – HasAdminResp
Calculated: Y
Calculated Value: IIf(InList(‘Siebel Administrator’,GetProfileAttrAsList(‘User Responsibilities’)), ‘Y’, ‘N’)
function Applet_Load ()
{
/******************************************************************************
* Created By: Iain Ollerenshaw
* Created On: 12th December 2011
* Purpose: Called on Applet Load
*
* Modification History:
*
* Date Who Comment
* 12/12/2011 Iain Ollerenshaw Added code to hide 'Admin' button
******************************************************************************/
// First, determine if user has the 'Siebel Administrator' Responsibility
var isAdmin = TheApplication().GetProfileAttr("Me.OLI - HasAdminResp");
// If not, find and hide the control
if (isAdmin == "N")
{
var oCtrl = this.FindActiveXControl("Admin");
if( oCtrl != null )
{
// Hide the control
oCtrl.style.visibility="hidden";
}
}
}
It’s a shame that so much code is required to do something so simple. Hopefully, ‘Hide Control’ will make it into the base classes sometime in the future.
Happy Holidays!



