Lotus Script On Error Goto Next
Contents |
Coding and Development View All Ajax Development Security Eclipse HTML J2EE Java JavaScript LEI and DECS Domino Designer Agents Application Development Formula Mobile and Wireless no resume error in lotus notes Development Web Development XML and Web Services IBM Lotus
On Error Goto 0
Messaging and Collaboration Clients View All Domino Web Access (iNotes) Lotus Notes 5 Lotus Notes 6 Lotus Notes 7 Lotus Notes 8 Lotus Sametime Instant Messaging Mobile Devices IBM Lotus Messaging and Collaboration Servers View All IBM WebSphere http://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.0/com.ibm.designer.domino.main.doc/LSAZ_ON_ERROR_RESUME_NEXT_OVER.html Lotus Domino Server 5 Lotus Domino Server 6 Lotus Domino Server 7 Lotus Domino Server 8 Lotus Quickr Notes/Domino Administration View All Domino Directory Administration Tools AdminP LDAP Calendar and Contact Management Interoperability Licensing Monitoring and Logging Performance User Settings Notes.ini Notes/Domino Coding and Development View All http://searchdomino.techtarget.com/tip/LotusScript-error-handling Ajax Development Security Eclipse HTML J2EE Java JavaScript LEI and DECS Domino Designer Agents Application Development Formula LotusScript Mobile and Wireless Development Web Development XML and Web Services Notes/Domino Data Management and Storage View All Archiving Backup and Recovery Clustering Database Management Hardware Management Mailbox Management Replication and Synchronization Storage Management Notes/Domino Deployment and Migration View All Deployment and Migration Advice Deployment and Migration Tools Notes/Domino Security View All Compliance Management Compliance tools Access, Permissions and Authentication Antispam Software and Spam Filtering Antivirus Software and Virus Protection Email Compliance Email Encryption Firewalls Password Management Phishing and Email Fraud Protection Policy Management Topics Archive View All Domino Resources Domino Resources - Part 2 Domino Resources - Part 3 Domino Resources - Part 4 Domino Resources - Part 5 Domino Resources - Part 6 Domino Resources - Part 7 Domino Re
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/20327816/how-to-capture-error-message-in-lotusscript the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow http://www.fabriquedimages.de/help/help7_designer.nsf/2e73cbb2141acefa85256b8700688cea/94c21fabc5e7a56b8525704a00402872?OpenDocument Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each on error other. Join them; it only takes a minute: Sign up How to capture error message in LotusScript up vote 0 down vote favorite I want to capture error message in error handler and use it in if condition: errorhandler: Print "Error in function TriggerMail -- " & Cstr(Error) & " -- occured at line - " & Cstr(Erl()) on error goto MsgBox CStr(Error) If CStr(Error) = "Unable to send mail, no match found in Name & Address Book(s)" Then curdoc.Flag = " Invalid Short name" Call curdoc.Save(False, True) end if I am using cstr(Error) which I got and and validtaing...Though my 'If' condition is true it is skipping the condition. Please correct me and tell me some alternative way. Tried using error number still not able to get into if loop Call doc.Send(False, False) If Str(Err) = "4294" Then curdoc.Flag = " Invalid Short name" curdoc.defaulterSLACount = CInt(defaultCount) Call curdoc.Save(False, True) Else ''--------------------------------------------------------------------------------------------------------------- ' Flags set in the week doc of the defaulter for reference 'curdoc.Flag = "Mail Sent Successfully" curdoc.SentTo = doc.sendTo curdoc.CopiedTo = doc.CopyTo curdoc.SentOn = Cstr(Now) curdoc.defaulterSLACount = Cint(defaultCount) Call curdoc.Save(False, True) End If Else curdoc.Flag = "Mail Not Sent" curdoc.defaulterSLACount = Cint(defaultCount) Call curdoc.Save(False, True) End If ' -------------------- DefaulterCount If Check ends here Exit Function errorhandler: Print "Error in function TriggerMail -- " & Cstr(Error) & " -- occured at line - " & Cstr(Erl()) MsgBox Str(Err) Resume Ne
syntax is: Err = errNumber The error number can be set automatically by LotusScript, when an error occurs, or explicitly by this statement in a script. Whenever the error number is set, LotusScript automatically sets the value of the Error function to the error message associated with that error number. If the error number is set to 0, LotusScript sets the value of the Error function to its initial value, the empty string (""). The Err statement does not create an error as the Error statement does. It only resets the error number (and also the value of the Error function). So the error number Err may be nonzero while there is no current error. The Error statement The Error statement creates an error, and optionally specifies an error message associated with that error. The syntax is: Error errNumber [ , msgExpr ] If you do not include the optional msgExpr string in the statement, it creates an error when the script runs. If errNumber is the number of an error that is already defined, then the effect of this statement is the same as if that error occurred when the script executed. For example, LotusScript defines a division-by-zero error with the error number 11. So the following statement has the same effect as an actual error occurring when LotusScript executes a statement that attempts to divide by zero: Error = 11 If you include msgExpr in the Error statement, you specify the error message to be reported when the error occurs and no error handling for the error is in effect. Handling errors: the On Error statement Every error recognized at run time has its own error number that identifies it. When a recognized error happens during script execution, LotusScript records the error number, and then proceeds as directed by an On Error statement that refers to that number. For example, you can write either one of these On Error statements to tell LotusScript how to respond to an occurrence of error number 357: On Error 357 GoTo apoc600 On Error 357 Resume Next When referring to a pre-defined error in an On Error statement, you can use the defined constant for the error instead of the e