Showing posts with label User Properties. Show all posts
Showing posts with label User Properties. Show all posts

Monday, May 19, 2014

Siebel Open UI: Format All the Lists - Part 1

In an attempt for a real-life scenario of customizing the appearance of all list applets in a Siebel Open UI enabled application, I would like to introduce you to a coding experiment for conditional formatting of list columns.

As usual, let's see what we want to achieve:

Click to enlarge.
As you can see from the above screenshot, the Opportunity List Applet has two columns - Revenue and Probability % - which are conditionally formatted depending on their value. End users are able to use CTRL+click on the column header to display a prompt where they can enter a target value to influence the background color of the cells.

This solution should be applicable to all list applets. In this and the following post, I will lay out the steps to achieve a generic solution for the requirement presented above. The example solution focuses on numeric columns but can be easily applied to other data types as well.

The following are the main ingredients:

  • Applet User Properties
  • Custom Presentation Model
  • Custom Physical Renderer

Today, we'll focus on the first two points:

Using Custom Applet User Properties in Siebel Open UI

As a frequent reader of this blog, you are aware of the ClientPMUserProp applet user property introduced with Innovation Pack 2013. This user property is used by Oracle to define standard applet behavior such as drag and drop to and from list applets or collapsible/expandable headers.

We can also define our own custom user properties and - as they will be forwarded to the Open UI framework - can use them in the browser-side code to control the behavior of our customizations.

To implement the conditional formatting example, I chose to define two custom user properties:

  • CF Field List: A comma separated list of business component fields which - should they be exposed as list columns - will be conditionally formatted.
  • CF Threshold List: A comma separated list of numeric values which defines the default target values for the respective fields.

To add these user properties to an applet, we have to edit the applet in Siebel Tools and do the following:

  1. Open the list of Applet User Properties for the applet.
  2. Create three new user property records as follows:



Name
Value
ClientPMUserProp
CF Field List, CF Threshold List
CF Field List
Primary Revenue Amount,Primary Revenue Win Probability
CF Threshold List
500000,50

The above settings apply to any list applet using the Opportunity business component, for example the Opportunity List Applet.

Here is a screenshot documenting the work:

Click to enlarge.
We have to consider that when the ClientPMUserProp user property is already defined for an applet, we must add our new user properties to the list, using commas as the separator. Alternatively, the user property can be sequenced, so we can define multiple instances like ClientPMUserProp1, ClientPMUserProp2 and so forth.

With this technique we can define a list of fields which should be conditionally formatted and the default target value for any list applet. Of course the field names must match exactly those of fields available in the applet's BC.

Ah, and yes, don't forget to compile the applet(s).

Accessing Custom User Properties in a Presentation Model

Any user property defined in the ClientPMUserProp value will be propagated to the property set used to set up the presentation model of the UI object.

As Siebel Bookshelf states, we can currently do this with individual controls, applets or views. To be able to access the values of the custom user properties, we must extend the presentation model and override the Setup method of the custom PM. This is because the Setup method receives a reference to the current object's property set.

The following code shows the Setup method of a custom presentation model extension class, accessing the user properties we created above.

Click to enlarge. Example code for IP 2013 (8.1.1.11)
The screenshot shows the full code with the important lines highlighted.

As you can see, we use a reference to the Oracle-defined set of constants to retrieve the name of the property set containing the applet user properties (SWE_APPLET_PM_PS). This is a recommended practice to avoid issues should Oracle engineering decide to change the naming convention in a future release.

Then we can use the GetProperty method of the property set to retrieve the values of the two custom user properties we created in the first step in Siebel Tools and store them as "local" PM properties so that we can easily access them from the physical renderer.

The custom presentation model must be administered in the manifest as usual and associated with a test list applet (recommended) and later with the DEFAULT LIST APPLET entry (IP 2013 and later). For testing purposes it is recommended to use a single test applet and use SiebelJS.Log() to print the user property values to the browser's JavaScript console.

The Story so far

With the above configurations, we have set the foundation for writing a generic physical renderer extension for list applets which evaluates the user properties and formats the respective list columns accordingly.

Please stay tuned for the second part of this mini-series where we will discuss a possible approach for this solution.

have a nice day

@lex

Wednesday, July 27, 2011

Child Field Read Only depending on Parent Field Value

Sometimes it happens that you get a very simple requirement to implement and in a single glance you say, "Well, this is very easy to implement" and when you actually see the result on the UI after the configuration you have done, you start scratching your head to find out the reason for not getting the result as per the expectation.Today, I am going to discuss a very simple requirement you might

Friday, July 15, 2011

How to make all Child BCs read-only when Parent BC becomes read-only?

Today I am going to discuss one interesting requirement where you are required to make all the Child Business components read only as soon as the Parent business component becomes read-only.Actual scenario goes like this: As per the business requirement, we need to have the Opportunity business component read-only when Sales Stage is Approved. For this simple requirement we configure the BC User

Thursday, May 19, 2011

Query performance issue : Dedicated Client Vs Thin Client

Very strange behaviour I observed today while working on a performance issue where whenever user do a query in Purchase Order Pick applet, query was taking more than 1 minute to execute in thin client but the same query behaves perfectly fine in dedicated client.So while working on any performance issue, you always want to see the performance on dedicated client as well, so I did the same.1. Took

Monday, November 22, 2010

Launching a Workflow Process from a Business Component

One way to replace business component scripting with more declarative configuration is by using Siebel Workflow. A workflow process can perform many of the same operations that you can configure with eScript. If you want to execute a workflow when a BusComp field is updated, you can invoke it from scripting in the SetFieldValue event of the business component. There is, however, the option of using business component user properties for a completely declarative solution.

An example of using the applet version of the Named Method n user property to invoke a workflow process can be found in Siebel Bookshelf. The same user property is available for business components. An example of a named method declaration follows:

User Property Name: Named Method 1
User Property Value: "MyInvokeWFMehod", "INVOKESVC", "Employee", "Workflow Process Manager", "RunProcess", "'ProcessName'", "'The Do Something Cool Workflow Process'", "'WorkPhone'", "[Work Phone Number]", "'Login'", "[Login Name]", "'RowId'", "[Id]"

In this example, "MyInvokeWFMehod" is the name I give to the named method. "Employee" is the name of the business component. "The Do Something Cool Workflow Process" is the name of the workflow process. After the workflow process name, a series of name-value pairs are additional parameters passed to the workflow. "WorkPhone" and "Login" are process properties of the workflow process. Each process property name can be followed by a bracketed field name or business component expression. "RowId" is a method argument of the Workflow Process Manager business service that passes its value to the "Object Id" process property of the workflow.

Please note that parameter names and literals must be in quotes, despite the fact that the user property arguments are already in quotes, which results in the strange syntax of "'Literal Value'".

Another user property is also usually required to invoke the named method, unless the named method is already invoked by the business component itself. To invoke the named method upon a field being updated, use the On Field Update Invoke n user property. For example:

User Property Name: On Field Update Invoke 1
User Property Value: "Work Phone Number", "Employee", "MyInvokeWFMehod"

When the "Work Phone Number" field of the "Employee" business component is updated, the "MyInvokeWFMehod" named method is invoked, which calls the "RunProcess" method of the "Workflow Process Manager" business service, which acts as a proxy for the "Workflow Process Manager" server component, which executes the "The Do Something Cool Workflow Process" process, using values passed from the business component directly into workflow process properties.

In summary, use the On Field Update Invoke n business component user property together with the Named Method n business component user property and your own workflow process for a completely non-scripted way to add complex logic to the event of updating a business component field.

Saturday, January 16, 2010

Difference between Today() and TimeStamp() while used in Calculated field !!

Here is something interesting I found today while working on a requirement in which we need to capture the timestamp of the record when a field get updated.So the exact requirement was : Capture the timestamp of the record when the Status of the Service Request changes to Approved. The field used for this purpose named as "SR Approved On".Now this requirement seems very simple and the very first

Friday, December 18, 2009

How to apply Oracle hint in query via Siebel Configuration?

Our team was facing one performance issue in our application in which navigation to a view was taking hell lot of time. As every Siebel developer does, we also spooled the query which is running in the background and found the culprit query for the issue. SQL query seems to be very simple:SELECT T1.CONFLICT_ID, T1.LAST_UPD, T1.CREATED, T1.LAST_UPD_BY,T1.CREATED_BY, T1.MODIFICATION_NUM, T1.ROW_ID,