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.
[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
Those are the articles I love reading your blog for! I will definitely try it. Thanks and keep on going!
ReplyDeleteHi,
ReplyDeleteThere 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
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).
ReplyDeleteThanks Nanpats, CTI is an option, but you have to define browser scripts to show the dialog.
ReplyDeleteIt is possibbly a 8.1+ release, as I cannot see it in 7.8.
ReplyDeleteDon't you need life sciences licenses to use this Business Service?
ReplyDeleteThanks,
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.
ReplyDeleteIt is not limited to LS, i found this in a PUB vertical.
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 ... :( ..
ReplyDeleteThis 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.
ReplyDeleteI couldn't find the BS 'LS Pharma Signature UI Service' in Firld Service. Is it specific to Life Science Module?
ReplyDeleteUsing 'LS Pharma Signature UI Service' BS in Applet server script throws error 'SHM Program Name' is required. Any idea why?
ReplyDeleteIt could be a difference in the class code in your version of Siebel.
ReplyDeleteTry supplying "SHM Program Name" as an input property to the method call.
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.
ReplyDeleteRegardless it is a great tip that could likely be applied for certain business requirements.
is it possible integrate LS Pharma Signature UI Service into a custom business service?
ReplyDeleteI 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.
ReplyDeleteI tried to find where is expected my custom method to be declared, but i have no lucky.
any Ideas?
Hi Omar,
ReplyDeleteIt sounds like the methods aren't propagating from the BS to your BC. Try double checking your input args
What to do if we want to invoke a custom method and not siebel defined methods like new record?
ReplyDeleteCustom methods are used in the above article, you'll just need to define a handler for them
ReplyDeleteI 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!
ReplyDeletecan you please provide me the solution of following:
ReplyDelete1) 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.