Bookshelf Home | Contents | Index | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Application Methods > EnableExceptions MethodThe EnableExceptions method enables or disables native COM error handling. SyntaxApplication.EnableExceptions(bEnable) ReturnsUsageSetting the argument to TRUE enables native error handling. This allows applications to intercept and display the exception ID and description. Native COM error handling is disabled by default. Used WithCOM Data Control, Mobile Web Client Automation Server ExamplesThis native Visual Basic script uses the Siebel ActiveX Data Control to connect to the Siebel Application and instantiate a business object. The script prompts the user to select whether the native error handling is to be enabled or not. If yes, the script throws the error immediately when it gets an error. If not, the script suppresses Siebel errors and errors are only detected by using GetLastErrCode method. Dim SiebelApplication As SiebelDataControl Set SiebelApplication = CreateObject("SiebelDataControl.SiebelDataControl.1") SiebelApplication_first.Login "host=""Siebel.TCPIP.none.none://<virtual ip>:<port>/<enterprise>/<object manager>""", "<user id>", "<password>" nativeHandle = InputBox("Use native error handling?", "", "Yes") If nativeHandle = "Yes" Then Set wrongBO = SiebelApplication.GetBusObject("No Such One") 'intended to create an error at this line by instantiating a non-existing Business Object errCode = SiebelApplication.GetLastErrCode() This Visual Basic sample code uses the Siebel Mobile Automation Server to connect to the Siebel Application and instantiate a business object. The program prompts the user to select whether the native error handling is to be enabled or not. If yes, the script throws the error immediately when it gets an error. If not, the script suppresses Siebel errors and errors are only detected by using GetLastErrCode method. Dim SiebelApp As SiebelWebApplication Set SiebelApp = CreateObject("TWSiebel.SiebelWebApplication.1") Dim nativeHandle As String If nativeHandle = "Yes" Then Set wrongBO = SiebelApp.GetBusObject("No Such One") 'intended to create an error at this line by instantiating a non-existing Business Object errCode = SiebelApp.GetLastErrCode() |
Siebel Object Interfaces Reference |