Server Confirm dialog (Scriptless)

[Background]

Every Siebel professional knows that its impossible to get input from the user using Server script. The rationale is that server script runs on the server, and theres no way that it can pop something up on the client. Whats more ludicrous is to do it without any script.

Google for "Siebel Confirm" and you'll get a bunch of results stating that this is only possible using Browser Script.

Search in support web and you'll probably end up with these documents

1. How Should You Implement Message and Input Boxes in Siebel 7 and Siebel 8? [ID 476612.1]

2. How Can You Display a Message from a Server Script on the Browser? [ID 477323.1]

The conclusion is the same:

"Interactive dialog boxes are features that belong to the JavaScript language and can only be launched from browser script"

That sounds like solid advice, so would you believe me, if i told you that its possible to invoke a Confirm dialog from the server, using out of the box functionality?

Did i hear someone say "NO"!? Okay, that might have been my sub conscious.

If you are not convinced, let me introduce you to an undocumented business service that does just this.

[Confirm Dialog Business Service]

Business Service: LS Pharma Signature UI Service
Method Name:
ShowConfirmDialog

Open up Siebel and goto your business service simulator, and load up the following values

Inputs:
Cancel Method Name:
MyCustomMethod1
Confirm Text:
Winona, will you marry me?
OK Method Name:MyCustomMethod2

Your view should look like this.



Click run, and VOILA.



This produces an Ok,Cancel dialog that can be used across the application, but best of all, it is scriptless.

Now click either button, and you should get an error.


This happens because we havnt configured the application to handle these custom events, but lets try to invoke methods that we do know exist, and we'll perform some real configuration instead of basing our results off the simulator.

[Configuration]


Find your favourite BC and add the following user property, this will enable a custom method, and call the business service to display our Confirm Dialog.

Named Method

"InvokeAction", "INVOKESVC", "WS Transaction Settings", "LS Pharma Signature UI Service", "ShowConfirmDialog", "'Cancel Method Name'", "'NewRecord'", "'Confirm Text'", "'Hello'", "'OK Method Name'", "'DeleteRecord'"

Next find your favourite applet, and add a new button and set the following property:

Method Invoked: InvokeAction

The Ok and Cancel method definitions, will fire the respective events from the Applet to the BC, and from Browser to the Server, just like normal events, which you can subsequently trap and perform the intended action, based on the user response.

[Results]

NewRecord
This creates a new record in the applet

NewQuery This toggles the applet into Query mode

DeleteRecord
Interestingly, this brings up another confirm dialog. Infact, it looks damn similiar my own confirm dialog, except for the question text.

[Conclusion]


If you look hard enough, you'll find examples of this all over the application, heres another business service that does the same thing, except the message, and return codes are hard coded

Business Service: LS SubjectVisits Service
Method Name: ShowConfirmationDlg

This raises a few questions in my mind

1. Why isnt this documented?
2. Can we have control over how the dialogs are presented?
3. Can we display a message or prompt dialog in the same manner?

Maybe someone from Oracle engineering can answer this, but suffice to say, this is a great little nugget for Impossible Siebel readers.

On a closing note, if you would like more pizazz in your popups, change the buttons or add an icon, have a read of Alex's UMF Series, on Siebel Essentials. It should cover my requirements above.

Siebel Unified Messaging Framework - Part 1

Siebel Unified Messaging Framework - Part 2


Reactions:

20 comments:

  1. Those are the articles I love reading your blog for! I will definitely try it. Thanks and keep on going!

    ReplyDelete
  2. Hi,

    There is a scripting method available to display a prompt window from server script. Details on the configuration are available in Siebel bookshelf. The link is http://download.oracle.com/docs/cd/B40099_02/books/CommSrvAdm/CommSrvAdm_AdvConfig40.html

    I have tried the method and it works.

    Just one catch using the above methodology. The CTI command that you invoke is an asynchronous request on the Web Server. Hence you would like to be very careful with the logic flow.

    All the best.

    Regards,
    Narayan

    ReplyDelete
  3. Wow, that is what i missed very much in Siebel! Excep I can not find de Business Service "LS Pharma Signature UI Service" here (8.0 SIA Consumer Goods).

    ReplyDelete
  4. Thanks Nanpats, CTI is an option, but you have to define browser scripts to show the dialog.

    ReplyDelete
  5. It is possibbly a 8.1+ release, as I cannot see it in 7.8.

    ReplyDelete
  6. Don't you need life sciences licenses to use this Business Service?

    Thanks,

    ReplyDelete
  7. It should be part of SIA, have a look through your respository, and you'll see services for other verticals, common ones are FINs, UCM, PUB etc. Your lucky will vary from version to version.

    It is not limited to LS, i found this in a PUB vertical.

    ReplyDelete
  8. We've tried this vanilla BS however it doesn't work on server side. It may be due to license .. we might have Life Sciences license in order to be able to use it .. and yes, we copied this BS, but still doesn't work ... :( ..

    ReplyDelete
  9. This only seems to work when invoked from an applet button. Invoking the business service from a BC event, even something innocuous like WriteRecord, does not pop up the confirmation dialog window.

    ReplyDelete
  10. I couldn't find the BS 'LS Pharma Signature UI Service' in Firld Service. Is it specific to Life Science Module?

    ReplyDelete
  11. Using 'LS Pharma Signature UI Service' BS in Applet server script throws error 'SHM Program Name' is required. Any idea why?

    ReplyDelete
  12. It could be a difference in the class code in your version of Siebel.

    Try supplying "SHM Program Name" as an input property to the method call.

    ReplyDelete
  13. This indeed only works when invoked from the applet. I got the popup to appear when the applet invokes the WriteRecord method by explicitly calling a method from the Applet InvokeMethod event. Unfortunately for our particular needs, the applet WriteRecord event fires after both PreWriteRecord and WriteRecord on the BC. We need a confirmation message before the record is committed to the database.

    Regardless it is a great tip that could likely be applied for certain business requirements.

    ReplyDelete
  14. is it possible integrate LS Pharma Signature UI Service into a custom business service?

    ReplyDelete
  15. I integrated this BS into my Script, it shows the popup, but i can't fire the Methods for Ok and Cancel, it shows a message with "The Method "" is not allowed here", but my method is already declared in BC.
    I tried to find where is expected my custom method to be declared, but i have no lucky.

    any Ideas?

    ReplyDelete
  16. Hi Omar,

    It sounds like the methods aren't propagating from the BS to your BC. Try double checking your input args

    ReplyDelete
  17. What to do if we want to invoke a custom method and not siebel defined methods like new record?

    ReplyDelete
  18. Custom methods are used in the above article, you'll just need to define a handler for them

    ReplyDelete
  19. I love this, mate - thank you! Why on earth don't Oracle make these methods more generic and document them? This is an incredibly useful mechanism that satisfies a common requirement yet is undocumented and, presumably, unsupported?! Mental!

    ReplyDelete
  20. can you please provide me the solution of following:
    1) how can i change the name of the bip report generated as the one of the fields in siebel 8.0. eg. when you select the report and the system asks you the format in which report should be generated it opens a save button it should have name of report as SR# of the report in it.

    ReplyDelete

Comments are open to all, please make it constructive.