Tuesday, August 25, 2009

Refreshing a record in Siebel applet - Possible ways !!

Sometimes it happens you clicks on a button on an applet which is supposed to do some modification on the current record but you get an error saying : The selected record has been modified by another user. This happens when the same record has been updated into the database (by another user or some other process like Workflow, EAI etc) and system is trying to update the old context of record on the UI. So the better way to get the updated copy of the record by refreshing it and then do any modifications. But the bottom line is you should not loose the context of the current record, so if you are thinking of using ClearToQuery() and ExecuteQuery(), it will not solve the purpose here.

There are few possible ways by which you can refresh a record on the UI, without loosing the context of the current record, depending upon the requirement you can take the decision which one to use.

1. RefreshRecord : Business Component Method

This is a method available on Business Component which are derived from CSSBCBase class. Here is how you can use it, if writing code in PreInvokeMethod of applet :
if (MethodName == "MyMethod")
{
this.BusComp().InvokeMethod("RefreshRecord");
...............................................
}

This method will just refresh the highlighed record on the UI.

2. RefreshBusComp : Business Component Method

This is similar to RefreshRecord method available on Business Component which are derived from CSSBCBase class. The only difference is that it will refresh all the records in the current query context :

if (MethodName == "MyMethod")
{

this.BusComp().InvokeMethod("RefreshBusComp");
...............................................
}

3. FINS Teller UI Navigation : Business Service

Unlike RefreshRecord and RefreshBusComp, this business service can be used for refreshing any applet/buscomp, no matter which class it has been derived from. The method need to use is "RefreshCurrentApplet".
if(MethodName == "MyMethod")
{

TheApplication().GetService("FINS Teller UI Navigation").InvokeMethod("RefreshCurrentApplet", TheApplication().NewPropertySet(), TheApplication().NewPropertySet());

}


.


11 comments:

  1. Hey Thanks for the post!!!
    I had a question here ...
    Does the "FINS Teller UI Navigation" works in every Horizontal/Vertical application or it is limited to a few Applications where we can use it.

    ReplyDelete
  2. Nikhil,

    This business you can use in any application, but this might be a question in one's mind that whether it is available with the Siebel version which he is using, and the best part is that it is available in 7.5, 7.7, 7.8, 8.x.

    ReplyDelete
  3. Gaurav, This is a cool post !
    You can also link to my blog
    http://geeksajan.blogspot.com
    --- geeksajan

    ReplyDelete
  4. Gaurav,
    Couldn't find 'FINS Teller UI Navigation' BS in Tools in siebel 7.8.2.14
    --Thanks

    ReplyDelete
  5. Hi Gaurav, I am facing one problem in MVG applet. As per some our requiremnt we need to modify some field values in MVG applet and but other records should be readonly. my problems child BC is linked to Intertable. But we are unable to get the values in same applet without requering applet.Please help me out.

    ReplyDelete
  6. The name of the BS starts with FINS which means it is a vertical specific BS and will only be available in SIA vertical applications and not all applications...

    ReplyDelete
  7. Thanks for this Post Gaurav.
    As you rightly said, the first two options did not work for me because the Class of the BC which I updated was 'CSSBusComp'

    Error: The specialized method 'RefreshRecord' is not supported on Business Component '' used by Business Object ''.(SBL-DAT-00322)

    I tried the third option and it worked with out any errors. After record create/update, all the Joined fields were shown with correct values in the Applet.

    ReplyDelete
  8. This is very nice. Thanks a lot!

    Cheers,
    Suman

    ReplyDelete
  9. Really nice Blog... Defined very clearly.. Thank u..

    ReplyDelete
  10. Can the RefreshRecord method be used in Run Time events?

    ReplyDelete
    Replies
    1. Good Post..Resolve my issue, I was strugling for 1 full day for the solution,

      Thanks

      Delete