Pages

Wednesday, March 22, 2017

Script Not compiling when the object is compiled

This is a very basic functionality. But some one can spend hours searching in the web for a solution. 

The issue here is when we add/edit a server script and we compile the object, (Applet/Business Component etc.) the server script won't get compiled. Also when we try to exit Siebel Tools, we get a warning similar to below;

The following scripts have been saved but not compiled into the SRF. Press "OK" to exit. Press "CANCEL" to stop exiting Siebel Tools


This can happen specially in Opportunity Business component, BusComp_PreSetFieldValue method, as there is a vanilla script added and when we try to modify code.

The cause of the issue is that, the inactive flag is on for this script.

To fix the issue, You have to go to Business Component --> Select the required business component ('Opprtunity' in above case). Then go to BusComp Server Script (You have to make this visible from View --> Options --> Object Explorer) and remove the inactive flag

Compile the object and it will work.

Tuesday, January 24, 2017

Enable/Disable Export menu item conditionally in list applets

Enabling or disabling a button conditionally is pretty common requirement in Siebel. There are many ways to do so, you can choose any of these based upon your requirement but as you know, it is always advisable to get rid of scripting as much as possible. Here I will only describe about one method which is easy and script less.

We use applet user properties for this configuration.

Method of configuration

By default "Export" is enabled in list applet menu. So we will create a responsibility, for which we will disable the menu item "Export". Who ever the users assigned with this responsibility will see "Export" as disabled in the list applet. 

Step 1.
Create a responsibility and assign a test user. (Eg. We create "No Export" responsibility). No need to associate any views.
For more information in creating a responsibility, refer below link
https://docs.oracle.com/cd/E14004_01/books/DevDep/CompanyStructure6.html

Step 2.
Find the applet you want to restrict the "Export" (Eg. We'll select "SIS Account List Applet" for this)

Step 3.
Go to Siebel Tools and query the applet 'SIS Account List Applet' and go to Applet User Properties.

Step 4.
Create new record where Name= 'CanInvokeMethod: ExportQuery' and Value = GetProfileAttrAsList("User Responsibilities") NOT LIKE "*No Export*"

Step 5.
Compile the object changes to srf and check with the user user login assigned with above responsibility.

Explanation;
 1. CanInvokeMethod : is used to define whether the button or other user property should   be enabled or disabled.
          Syntax : Name = CanInvokeMethod: MethodName
                        Value = TRUE/FALSE

 2. GetProfileAttrAsList(“User Responsibilities”) : is used to get the responsibilities assigned for the current logged in user. This will be retrieved as a comma separated list

 3. InList : Will determine whether the given string in the first argument is in the second  comma seperated list"



Avoid scripting in ‘PreCanInvoke’ event as much as possible and use ‘CanInvokeMethod’ user property as an alternative

Feel free to comment here..