Tuesday, June 17, 2008

A Conditional, Data-Driven Action Link

The initial release of this functionality was seen as a positive step towards tighter integration of the Siebel and Analytics applications. Since then, many versions onward the functionality has moved on little and there are still limitations which continue to frustrate developers.

The 'so-called' increased usability of action links available in v7.8.x onwards is buggy and doesn't provide the same 'mouse-over' information when choosing the custom data format route (accessed via the 'Data Format' tab for the column in the request); so personally, I prefer the custom data format. The syntax can take a little getting used to, but is straightforward to manipulate once you understand the components.

Current limitations aside (such as the inabilty to target child applets in Siebel), a little more intelligence can be added at the request level to make your action links conditional, based on the data you return in your request.

This might be performed using a CASE statement, but more complex functions could provide a range of results to use for your action links. For example column A contains your data, column B your conditional action link. The basic function syntax for column B would be as follows:

CASE Column A
WHEN = 1 THEN 'Action Link 1'
WHEN = 2 THEN 'Action Link 2'
ELSE 'Action Link 3'
END

So you have your basic conditional navigation here, but its important to get the syntax right for each action link created. Ultimately you want this to resolve correctly for the custom data format.

With a standard action link, normally 3 elements are provided in the custom data format: View, Applet and Row Id. In this case, you will provide all 3 elements as one string from column B and amend the data format slightly.

The string will need to be correctly 'escaped' for both Analytics to recognise it as a string, but also for it to resolve correctly using the javascript function NQSWENav, referenced when creating action links.

- Char(39) : SQL escape character for single quotes
- || : double pipes used by analytics here to concatenate strings
- , : commas separate the 3 arguments normally used in action links

Char(39)||'Order Entry - Line Items View (Sales)'||Char(39)||','||Char(39)||'Order Entry - Order Form Applet'||Char(39)||','||Char(39)||Order."Row Id" ||Char(39)

Notice you're adding 2 single quotes each time, the 1st one will be removed by the analytics server leaving the second one when using the javascript function. Add this string after the 'THEN' portion of your CASE statement. For each different condition in the CASE statement add the action link functionality using this syntax replacing the view, applet and row id arguments each time.

Your statement will probably looks something like this:

CASE Column A
WHEN = 1 THEN Char(39)||'Order Entry - Line Items View (Sales)'||Char(39)||','||Char(39)||'Order Entry - Order Form Applet'||Char(39)||','||Char(39)||Order."Row Id" ||Char(39)
WHEN = 2 THEN Char(39)||'All Service Request across Organizations'||Char(39)||','||Char(39)||'Service Request List Applet'||Char(39)||','||Char(39)||"Service Request"."Row ID"||Char(39)
ELSE Char(39)||'All Activity List View'||Char(39)||','||Char(39)||'Activity List Applet - Basic - No Toggle'||Char(39)||','||Char(39)||Activity."Activity Id"||Char(39)
END

Now that you've got your CASE statement, open the 'Format Column' portion of the request and go to the 'Data Format' tab. Make sure the 'Override Default Data Format' is checked and select 'Custom Data Format' from 'Treat Text As' drop-down list. In the 'Custom Text Format' add the following syntax:

@[html]"<a href=\"javascript:NQSWENav("@"); \">"More..."</a>"

- @ : refers to the contents of the column
- NQSWENav : the javascript function used to navigate to the Siebel application

It is recommended not to display the column contents, in this case it will be quite long, rather provide a meaningful link prompt (e.g. 'More...', 'Link...'), but this is entirely personal preference.

Look at the results of the request to check you've got the syntax right, then run it from your integrated application (Siebel/Analytics) to see those action links in action.

N.B. For those new to action links, it is the Row Id column from the base table which is required (not any other identifier) for action links to work correcly.

1 comment:

Anonymous said...

Hoping someone can help me - the issue is related to this "Action Link" article. We're upgrading systems, moving from Analytics 7.7 to OBIEE 10.1.3. Analytics Web used to sit on same IIS web server as Siebel CRM. In Analytics7 I used the following (parens were required to get the < and > symbols to show up in this blog):

[html]" (<)a href=\"javascript:NQSWENav('All Activity List View','Activity List Applet With Navigation','"@"'); \" (>) "@" (<)/a(>)"

This allowed report links to open the CRM Activity window (where "@" was populated with the value of ROW_ID). This worked in an environment where both CRM & Analytics resided on the same Windows machine and shared the same IIS web server.

We have now upgraded Analytics 7.7 to OBIEE 10.1.3, and have moved OBIEE to a very robust AIX machine which runs an Apache web server. My users do not want to loose the functional ease of running a report in embedded Analytics, clicking a link, and navigating to the relevant CRM form. This functionality is no longer working in the new split environment. I'm not surprised by this, but would like to get it working again if possible. Does anyone know how to get this to work across hosts and web servers?

The Cowes

The Cowes
Cowes Racing