Presentation Model Methods in Siebel Open UI (Training – Part 8)

You already know how to configure Presentation Model in Siebel Open UI. In this module we will discuss few frequently used Presentation Model Methods in Siebel Open UI that every Open UI developer should know.

Frequently used Presentation Model methods in Siebel Open UI:

  1. Define
  2. Init
  3. AddProperty
  4. SetProperty
  5. Get
  6. ExecuteMethod
  7. AddMethod

1. Define Method:

Siebel Open UI uses ‘Define’ method to locate the Presentation Model (PM) or Physical Renderer (PR) JS file and other dependent files. It must have a return statement like return “SiebelAppFacade.customclassname”;

Syntax: 

define (Module_name,List_of_dependencies,Function);

  • Module_name is the Presentation Model file name with file path but without file extension. 
  • List_of_dependencies is an array of all dependent modules required to execute PM JS file. If there is no dependency, keep it blank. 
  • Function identifies the function name and returns an object. 

Example:

// Define the presentation model file location and other dependencies if any

define(“siebel/custom/ShowHideFieldsPM”, [], function () {
— Write the code here—
return “SiebelAppFacade.ShowHideFieldsPM”;
});

2. Init Method:

Init stands for Initialization. It is used to initialize other methods or objects like AddProperty, AddMethod.

Syntax: Init()

Example:

ShowHideFieldsPM.prototype.Init = function(){
SiebelAppFacade.ShowHideFieldsPM.superclass.Init.call( this );
this.AddProperty(“ShowHideStatus”, “” );
this.AddMethod( “ShowSelection”, SelectionChange, { sequence : false, scope : this } );
};

3. AddProperty Method:

AddProperty method is used to add a property in Presentation Model. You can use ‘Get’ method to fetch the value from the property. AddProperty method returns ‘True’ if the property is created successfully otherwise ‘False’. A subsequent call to this method with the same property name will overwrite the previous value.

Syntax:

this.AddProperty(“propertyName”, propertyValue);

Example:

this.AddProperty(“ShowHideflag”, False);
SiebelJS.Log(this.Get(“ShowHideflag”));

4. SetProperty Method:

SetProperty is used to set the property value, created by AddProperty method. It returns ‘True’ if the property value is set successfully otherwise ‘False’.

Syntax:

SetProperty(property_name, property_value);

Example

this.SetProperty( “ShowHideflag “, true);

5. Get Method:

Get method returns the property value.

Syntax: Get()

Example:

this.AddProperty(“ShowHideflag”, False);
SiebelJS.Log(this.Get(“ShowHideflag”));

6. AddMethod Method:

AddMethod adds vanilla or custom methods to the Presentation Model. You can use ExecuteMethod to run the method that AddMethod adds. It returns ‘True’ if the method is added successfully, otherwise ‘False’.

Syntax:

AddMethod(“MethodName”, MethodDef(argument1, argunemtn2,… argument n), {MethodConfig : value});

   MethodName is the name of the method that Siebel Open UI adds to the Presentation Model

   MethodDef is an argument that helps to call another method

   Argument1/2..N are the arguments that AddMethod passes to the method defined in MethodDef

   MethodConfig can have below values

      ♦ Sequence:

               – Set it to ‘True’ if you want Siebel Open UI to call MethodName before the method that already exists in PM.

               – False if you want Siebel Open UI to call MethodName after it calls the method that already exists in PM.

               – Default value is False.

      ♦ Override:

               – If ‘True’, Siebel Open UI does not call the method that already exists in PM.

               – If ‘False’, Siebel Open UI calls the method that already exist in PM.

      ♦ Scope:

               – It defines the scope of the MethodDef.

Example:

this.AddMethod( “FieldChange”,  OnFieldChange, { sequence : false, scope: this } );

** You can not override any method that already exists in vanilla application by using Override as True.

7. ExecuteMethod Method:

ExecuteMethod is used to execute vanilla and custom methods in PM. ExecuteMethod returns a value from the method if it exists otherwise it returns ‘Undefined’.

Syntax:

this.GetPM().ExecuteMethod(“vanilla/custom method name”, arguments);

Sometimes it is written as this.ExecuteMethod(“vanilla/custom method_name”, arguments);

Example:

var controls = this.Get( “GetControls” );
var control = controls[ “Status” ];
var value = this.ExecuteMethod( “GetFieldValue”, control );

** If the method, specified in ExecuteMethod, is a custom method, then make sure AddMethod is used to add the method before calling ExecuteMethod.

Few less frequently used Presentation Model Methods:

  1. AttachEventHandler Method
  2. AttachNotificationHandler Method
  3. AddComponentCommunication Method
  4. AttachPostProxyExecuteBinding Method
  5. AttachPreProxyExecuteBinding Method
  6. OnControlEvent Method
  7. Setup Method

These are not highly used Presentation Model methods. If you want to know any of these methods, please let us know.

This ends our module on Presentation Model Methods in Siebel Open UI.

If you have any question, please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< Module 7: Debugging in Siebel Open UI                     Module 9: Physical Renderer Methods >>

Watch our YouTube Video on Presentation Model Configuration:

Error: Invoking service ‘Context Service’, method ‘GetRowSetData’ at step ‘Get Context Row Set’ (SBL-BPR-00162) (SBL-DAT-00215)”.

Have you seen below error message during Siebel configuration?

“Error invoking service ‘Context Service’, method ‘GetRowSetData’ at step ‘Get Context Row Set’.(SBL-BPR-00162)”.

Sometime it is followed by another error message – “This operation is not allowed when there are no records displayed. Please execute a query that returns at least one record or add a new record.(SBL-DAT-00215)”.

Recently one of our readers dropped us a mail asking solution to fix this issue.

This error usually comes up when we are working on Signals or variable maps or pricing workflows in Siebel. There could be many reasons behind this error but most common mistakes are –

1) PSP driver Workflow is not active
– Verify that the PSP driver Workflow is in active status. If not, activate the workflow, restart server and verify it once again, issue should be resolved.

2) Business components are not based upon class CSSBCOrderMgmtBase, CSSBCPecBase and their subclasses
– Signals can be invoked only for that business component if it’s base class is either CSSBCOrderMgmtBase or CSSBCPecBase or their sub classes. Mainly signals call be called from all order management related objects like Quote , Order, Product BCs. If we try to invoke signal from any other business components which are not based upon these classes, Siebel will throw this error.

Please share your experience if you have faced this issue for any other reason or these two solutions were not sufficient to fix this error message.

To know more, follow ‘TechOneStop on Facebook / Twitter / LinkedIn / Goolge+ or join our website as follower.
Sharing is caring, so please share this article with your friends.

<< SBL-EAI-08032: WSDL cannot be generated               SBL-SCB-00014 / SBL-NET-01023 >>

Clean up Siebel File System – Sfscleanup Utility

Clean up Siebel File System is one of major server maintenance activities. Over the time, Siebel file system becomes loaded with lots of invalid and orphan files. If you don’t clean up such files, it may impact on performance of Siebel application and also block hard disk space unnecessarily. To clean up such invalid and orphan files, Oracle provides an utility ‘Sfscleanup’. Here we will discus how to use sfscleanup utility to clean up Siebel file system.

But why files become invalid and orphan?

Well! there could be many reasons, like

  1. If you attach a file with a record and then delete that record
  2. If you attach a file and then change the URL type without deleting the record
  3. If you attach a file against a record and then without deleting that record, attach another file with the same record

How to run Siebel file system cleanup utility ‘Sfscleanup’?

Before running this utility, make sure you have SIEBEL_REPOSITORY environment variable set properly because sfscleanup utility refers environment variable to execute properly. To set SIEBEL_REPOSITORY environment variable correctly, you cloud run another utility ‘siebenv.bat’. We will discus about ‘seibenv’ utility in another article. Sfscleanup utility is located in ‘bin’ sub directory within Siebel server root directory. This utility processes each and every file in the file attachment directory.

Steps to clean up Siebel file system directory using ‘Sfscleanup’:Sfscleanup Siebel Utility

  1. Open command prompt and change the directory to the bin sub directory with in the Siebel Server directory
  2. Run sfscleanup.exe using below parameters

Prompt>sfscleanup /U <User ID> /P <Password> /C <ODBC Data Source> /D <Siebel Table Owner> /F <Path of the Siebel File System Directory> /X <Path of output file, mainly log file> /M <Path to move invalid file>

It would look like:
sfscleanup /U sadmin /P sadmin /C TECHONESTOP /D SIEBEL /F D:\sba81\FS /X D:\sba81\siebsrvr\log\sfscleanup.log /M D:\sba81\siebsrvr\log

Parameter Value Description Required
/U Username Username Id Yes
/P Password Password of the given user Yes
/C ODBC data source name Set this value to ODBC data source if SIEBEL_DATA_SOURCE environment variable is not set properly No if SIEBEL_DATA_SOURCE is set
/D Siebel table owner Set this value to Siebel table owner if SIEBEL_TABLE_OWNER environment variable is not set properly No if SIEBEL_TABLE_OWNER is set
/F Path of the Siebel file system directory Set this value to Siebel file system directory, do not append ‘att’ to the path directory Yes
/X Path of the output file Set this value to the path of out put file, mainly log file No
/M Path to move invalid files Set this value to the path where invalid/orphan files will be moved No
/N Remove older file versions * Set this value to ‘Y’ if you want to delete older version of file attachment. By default Siebel will keep these files marked as ‘ANCIENT’ No
/G Remove garbage file Set this value to ‘Y’ if you want to delete non siebel files from Siebel file system No
/R Generate report file Set this value to ‘Y’ if you want to generate report with File name and File Type No

 

Older version file means that corresponding attachment record exists in Siebel database but not the file revision number.

If you want to know more about Sfscleanup parameters, refer Cleaning Up the Siebel File System provided by Oracle.

Output file, generated by /X parameter, looks like below. It has three parameters – file name, file type and file operation.

sfscleanup utility

File Name:

This column contains the name of each file that was processed during the execution of Sfscleanup utility

File Type:

This column lists the type of each file that was processed. Below we have listed down all file types and associated operations that this utility performs to clean up Siebel file system.

File Type Description File Operation
CURRENT This file is valid file, it has corresponding record in file attachment table. KEPT
NEW This file is less than one hour old and sfscleanup utility does not check such file in file attachment table. KEPT
ANCIENT This file has corresponding attachment record in database but file version does not match KEPT if /N or /M parameter is not used

  • If /N parameter is set to ‘Y’, operation will be DELETED
  • If /M parameter is set to ‘Y’, operation will be MOVED
INVALID This file or directory is not a valid attachment. KEPT if /G parameter is not set to ‘Y’, otherwise DELETED
ORPHAN This file does not have corresponding record in File attachment table DELETED if /M parameter if not set to any value, otherwise MOVED

File Operation:

This column lists the type of operation performed on each file.

Operation Type Description
KEPT File is not deleted
DELETED File is deleted from file system
MOVED File is moved to the directory specified by /M parameter. Files will only be moved to the directory if the /M parameter is used.
KEPT_DIR Its a directory, not a file and need manual intervention to delete it
KEPT_ERROR File is kept as an error occurred during delete or move operation

 

Except Sfscleanup, there are another two important utilities ‘Sfspartition‘ and ‘Sfsutl‘ for Siebel file system. We will discuss these in our next article.

Now it’s time for action! Go and Clean Up Siebel File System!

Do you have any question? Please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< DBCHCK Utility

Highlight required fields in Siebel Open UI

Highlight required fields in Siebel Open UI – sounds interesting?

Let us discuss in details.

We all know about required fields in Siebel, right?

It means, users can not save the record keeping such fields blank.

Also, we know that in Siebel, every required field on form applet comes with a red asterisk on right hand side.

But,

What if we highlight all required fields beside red asterisk?

Does it look good?

Let’s take a look…

Highlight required fields in Siebel Open UI
No doubt, highlighted required field has better visualization than the other one.

In this article, we will discuss how to highlight required fields in Siebel Open UI.

Wait a minute,

Let us tell you few more real time scenarios as well except this one.

Highlight all required fields if users do not enter any value and try to save the record. But when the application loads, required fields come with a red asterisk only.

If users enter wrong value in a field, highlight that field with error message.

For example, if users enter numeric value in ‘Name’ field, highlight the name field.

There are n number of business requirements related to highlighted fields in Siebel.

Now,

Back to our topic…

Steps to highlight required fields in Siebel Open UI:

Step 1: Determine CSS tag (Optional step)

You know,

For any kind of visual requirements in Siebel Open UI, very first step is to find out the corresponding CSS tag for that particular element.

But why this step is optional for this requirement?

It is optional because we are not configuring our application for a particular field. We are going to highlight all required fields throughout application.

However, it is better to know the CSS tags behind required fields.

So, right click on the field and click on ‘Inspect element‘ to launch browser developer tool.

Browser developer tool is nothing but a vanilla tool provided by almost all modern browsers like Google Chrome, Mozilla Firefox, IE 8+.

To know more about browser developer tool, read our article onDebugging in Siebel Open UI‘.

Step 2: Build the new CSS file

You know about Cascading Style Sheet (CSS), right?

If not, try to get a basic idea about CSS. It is very much required to be Siebel Open UI developer.

To learn CSS, we would suggest you to go through w3schools – CSS tutorial.

Here,

We are going to use a simple notepad to write CSS rules. You could use any tool as per your choice.

CSS rules are –

input[aria-required=”true”], div.mceGridField input.siebui-ctrl-mvg[aria-required=”true”], input[aria-required=”true”] [readonly=”readonly”]

{

border-color: #CC0000 !important;

background: #FFCCCC !important;

color: red !important;

font-weight: bold !important;;

}

All CSS rules are self-explanatory except ‘!Important‘, isn’t it?

Purpose of using this CSS property is to override the default CSS priority rule. Any CSS property with ‘!Important’ will always be applied on the selector, no matter what all other rules appear in the CSS file.

Now save the file with .css extension. We have named our file – highlight_required_fields.css.

Remember, you must save the file with .css extension.

Step 3: Copy the CSS file

Did you go through our Siebel Open UI configuration best practices tutorial?

Yes! then you know,

According to Open UI configuration best practices, you should keep all custom CSS and JS files under custom folder/s.

But,

Do you know why Oracle suggests to keep all custom CSS and JS files under custom folder/s?

This is to avoid any unnecessary conflicts during application upgrade.

If you follow this practice, all vanilla files will be migrated to upper version without affecting any custom file.

So,

If you don’t have a custom folder already, create one and keep all custom CSS and JS files under that folder only.

Now, copy the .css file under ‘custom‘ folder and register it in theme.js file.

For dedicated client, copy the custom CSS file under ..Client/PUBLIC/<lang>/files/custom.

For Webclient, copy the file under ..webserver/PUBLIC/<lang>/files/custom.

Well,

Do you know how to register .css file in theme.js file?

Read the next step…

Step 4: Register the file in Theme.JS file

Once your .css file is ready, next step is to register the file in theme.js file.

You’re probably wondering…

Why theme.js file?

It is because we are doing this customization for ‘GRAY_TAB‘ theme only. This ‘GRAY_TAB’ theme is based on theme.js file.

And

Where do you find theme.js file in Siebel Open UI?

For dedicated client, navigate to  ..Client/PUBLIC/<lang>/<ver no>/SCRIPTS/siebel

For Webclient, navigate to ..webserver/PUBLIC/<lang>/<build>/SCRIPTS/siebel

Now open the theme.JS file in any text editor, register the CSS file and save it.

Script to register –

var ua=navigator.userAgent;

var re=new RegExp(“MSIE ([0-9]{1,}[.0-9]{0,})”);

if(re.exec(ua)!=null&&parseFloat(RegExp.$1)<=8)

{

var IE8inc=”files/ie8-compat.css”;

var IE8incTangerine=”files/ie8-compat-tangerine.css”

}

else

{

var IE8inc=””;var IE8incTangerine=””

}

SiebelApp.ThemeManager.addTheme(“GRAY_TAB”,{css:{sb_theme:”files/theme-base.css”,sc_theme:”files/theme-gray.css”,

sn_theme:”files/theme-nav-tab.css”,

sca_them:”files/theme-calendar.css”,

highlightreqfld:”files/custom/highlight_required_fields.css”,

sd_theme:IE8inc}

,objList:[]

});

Step 5: Register theme.js file (Optional step)

Another optional step to highlight required fields in Siebel Open UI application…

You may have theme.js registered already but it is better to verify!

To do so, login into application and navigate to Sitemap > Administration-Application > Manifest Files.

Here, query for theme.js file.

Customize Siebel Open UI

If the file is already there, no need to do anything.

But if not, create a new record to register theme.js file like below screenshot..

Now navigate to Administration-Application > Manifest Administration and create new UI objects, Object expression and add the file.

siebel open ui customization - highlighted required fields

Step 6: Verify changes

Finally,

Clear browser cache and reload the application…

You should see all required fields highlighted on Form applet.

Simple!

If you have any question, please let us know.

Also if you want us to discuss any business scenario in this ‘Configuring Siebel Open UI‘ series, please leave your comment below.

Don’t forget to leave your feedback in the comment section!

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Google+.

<< Change screen tabs icons                                       Customize the Server Busy error in Siebel >>

Watch our YouTube Video on how to configure Siebel Open UI to highlight required fields:

SBL-SCB-00014 / SBL-NET-01023: All component processes are maxed out

SBL-SCB-00014 All component processes are maxed out
SBL-NET-01023 Peer disconnected

Reason:

Siebel throws ‘SBL-SCB-00014’ error when a server component has more than maximum number of tasks that it can run concurrently on a server. Often error code ‘SBL-SCB-00014’ is followed by another error ‘SBL-NET-01023: Peer disconnected’.

How to Solve:

To fix this issue, you have to increase the number of tasks that the particular server component can handle concurrently on a Siebel Server.

There are 3 parameters for each component that determine maximum number of threads or tasks that can run in parallel.

MaxTasks: This parameter specifies the maximum number of tasks or threads that the component can run concurrently on a particular server.
MaxMTServers: It specifies the maximum number of multi threaded processes that the component can run concurrently.
MinMTServers: It specifies the minimum number of multi threaded processes that the component can run concurrently. For better performance, MaxMTServers and MinMTServers are typically set to same value. Also MaxMTServers value must be greater than or equal to MinMTServers value.

Set values like below to get the best performance:
MaxTasks = Number of targeted users plus anon users
MaxMTServers = MaxTasks / 100*
MinMTServers = MaxMTServers

* Number 100 represents the ratio of concurrent task per multi threaded process. It may vary from one Siebel Server to another. 
Read more about these three parameters in Siebel Bookself –  About MaxTasks, MaxMTServers, and MinMTServers

Steps to fix:

  1. First you find out the Siebel Server component that is causing this error. To do so, open SWSE log file and search for the error code. Component name should be followed by error message.
  2. Copy the component name and login into Siebel application as administrator.
  3. Navigate to Administration – Server Configuration screen > Servers > Components and query for the component
  4. Now on Parameters view tab, search for above 3 parameters and increase values as per your requirement. But before increasing parameters’ values, you need to check the hardware capability of the server also. More tasks you add, more hardware resources you need. It is advisable that you talk to your Siebel Server Maintenance team before updating any parameter value.

If you have faced these errors due to some other reasons, please share with us.

Do you have any question? Please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< SBL-DBC-00105 or ORA-00904                                                 SBL-EAI-04397 and SBL-BPR-00162 >>

Siebel Open UI examples

This is the common floor where we have listed down all Siebel Open UI examples that we have discussed so far. From now onward, everytime we will publish article on Siebel Open UI, will update this page also so that you can get all updates in one place.
For your convenience, we have listed down all articles from Siebel Open UI training series also.
Please let us know if you want us to discuss on any specific Siebel Open UI topic. 

Siebel Open UI examples:
– Click here to read ‘Configuring Siebel Open UI – Change icons on Screen Tabs‘ or watch our YouTube video here ‘Change icons on Screen Tabs‘ in Siebel Open UI
– Click here to read ‘Configuring Siebel Open UI: How to change application loading image’ 
– Click here to read ‘How to remove ‘Case Required’ prompt from all fields, displayed on home page search applet‘ or watch our YouTube video here ‘Remove Case Required prompt from all fields, displayed on home page search applet
– Click here to read ‘Welcome Username is not displaying on Home Page of Siebel Open UI‘ or watch our YouTube video here ‘Welcome Username is not displaying on Home Page of Siebel Open UI
– Click here to read ‘Configuring Siebel Open UI: Highlight required fields or watch our YouTube video here ‘Configuring Siebel Open UI: Highlight required fields


Siebel Open UI Training or Tutorial:
– Click here to read ‘Open UI Training(Session 1): What is Siebel Open UI, Its Features and benefits‘ or watch our YouTube video here ‘Open UI Training(Session 1): What is Siebel Open UI, Its Features and benefits
– Click here to read  ‘Siebel Open UI Architecture‘ or watch our YouTube video here ‘Siebel Open UI Architecture
– Click here to read  ‘Customizing the Presentation Model‘ or watch our YouTube video here ‘Customizing the Presentation Model
– Click here to read  ‘Customizing the Physical Renderer‘ or watch our YouTube video here ‘Customizing the Physical Renderer (Siebel Open UI Training, Part 5)
– Click here to read  ‘Customizing Manifest file (Siebel Open UI Training, Part 6)‘ or watch our YouTube video here ‘Customizing Manifest file
– Click here to read  ‘Siebel Open UI Theme‘ or watch our YouTube video here ‘Siebel Open UI Theme’
– Click here to read  ‘Siebel Open UI Debugging‘ or watch our YouTube video here ‘Siebel Open UI Debugging

You may also like:
– Click here to read  ‘Siebel Open UI Roadmap 2014 – 2020‘ or watch our YouTube video here ‘Siebel Open UI Roadmap 2014 – 2020
– Click here to read ‘Siebel Open UI Features – Drag and Drop in List Applet‘ or watch our YouTube video here ‘Siebel Open UI Features – Drag and Drop in List Applet
– Click here to read ‘Difference between Siebel Open UI 8.1.1.10 and 8.1.1.11
– Click here to read ‘How to apply Open UI patch on Siebel Sample/Local database

To get more updates on recent activities, follow ‘TechOneStop‘ on Facebook / Twitter / LinkedIn or join our website as followers.
Sharing is caring, so please share this article with your friends, so that we all can built a great Siebel Open UI community here.