Search code examples
siebel

How to refresh data in Siebel without running a new query?


I need to refresh an applet in Siebel, without executing the current query again. Is that possible at all?

My applet has a custom button which invokes a business service. This service performs some operations, and then updates the BC data (using a new instance of the BC - the data changes won't be visible on screen). Once it all ends, I need to refresh the applet, not only to show the new data, but also to enable or disable my custom buttons according to the new data.

So far, I know 4 ways to refresh data in Siebel, but none of them fits exactly what I need:

  • RefreshBusComp. It reloads the whole BC and executes again the current query. Which can lead to the current record "disappearing" if it no longer meets the query criteria.

  • RefreshRecord. It reloads only the current record, which is better in this case. The fields read only conditions are reevaluated aswell. However, the applet PreCanInvoke event is not triggered again, which mean that my custom buttons will not update their enabled/disabled status.

  • Execute a new query myself.

  • Using the FINS Teller UI Navigation service, method RefreshCurrentApplet (undocumented by Siebel... obviously). I thought this could be the answer, but it seems to work exactly like RefreshBusComp... it executes the current query again.

Is there any other option in Siebel 7.8?

(Without accessing directly the HTML controls with Javascript outside Siebel, please... I don't want to make a mess).


To clarify: I don't care if Siebel has to query the database again. I assume it will have to. But a simple select ... where row_id = '1-23456'; should be enough, I don't need to reload all the data in the BC, only the current record.

What I can't allow to execute again is the current BC-level query, which may or may not have been refined by the user. Why? Here is an example:

  1. An user executes the following query to filter the data: [Status]='Pending'. Then he selects one of the records, and clicks my custom button.
  2. The button invokes a business service, which performs some operations and changes the record status to 'Done'.
  3. If I execute the current query again (i.e. RefreshBusComp, or FINS Teller UI Navigation), it will reload all the records whose status is Pending. My record has another status now, so it will disappear from the applet. That's what I must avoid.

Solution

  • Siebel will run the last run query again during refresh, it does not have an option of keeping the selected record in the UI. You have a unique requirement here, you want to show the current selected record through the user defined query. You will have use some scripting.

    Get the row id of the current record.
    Get the current searchspec. Function GetSearchExpr.
    Concatenate a ' OR Id = "current rowid"' to the current search spec.
    Run the new query.
    

    If the current searchspec is "[Status] = 'Pending'", the new searchspec should be "([Status] = 'Pending') OR Id='0-1234'". That should keep the modified record in the UI even if it's status changes.

    Edit: I had a doubt the GetSearchExpr method will not work in Siebel 7.8, but I just checked, and it is documented.