Lotus Script Error Handling
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 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 Lotus Domino Server 5 Lotus Domino Server 6 Lotus Domino Server 7 Lotus Domino Server 8 Lotus Quickr http://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.0/com.ibm.designer.domino.main.doc/LSAZ_ON_ERROR_STATEMENT.html 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 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 http://searchdomino.techtarget.com/tip/LotusScript-error-handling 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 Resources - Part 8 Please select a category IBM Lotus Messaging and Collaboration Clients IBM Lotus Messaging and Collaboration Servers Notes/Domino Administration Notes/Domino Coding and Development Notes/Domino Data Management and Storage Notes/Domino Deployment and Migration Notes/Domino Security Section Manage News Get Started Evaluate Manage Problem Solve Sponsored Communities LotusScript error handling byChuck Connell CHC-3 Consulting T
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 http://lotus-blogs.blogspot.com/2008/12/error-handling-in-ls-better-way.html about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow 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 error goto each 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 - " & on error goto Cstr(Erl()) 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()) Ms
do error handling in lotus script, This gives following results if error occurs,But we can use better and more descriptive way to do error handling, something like, This gives following results if error occurs, You can find the difference.But don't forget to include "%INCLUDE "lsconst.lss"".Even you can do more if you play around with following table ,Pass any of the LSI_ constants from the table below to GetThreadInfo to have it return the current value of that constant. 1 Response to "Error Handling in LS , Better way !!" Jerry Shelley Says: July 28, 2009 at 2:41 AM I strongly suggest using Matt Holthe's Bubbling of Errors up to the main calling routine as exemplified here http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256D9100642353(no need to do all the errDoc stuff if you don't want to) Leave a Reply About Me Rishi Singapore View my complete profile Recent Comments Loading... Recent Posts Loading... Categories Dojo (2) Domino designer 8.5.1 (8) Domino Java (9) Java (1) Lotus Designer 8.5 (3) Lotus Designer 8.5.1 (2) Lotus Designer 8.5.2 (1) Lotus Notes (44) Miscellaneous (3) Quickplace (7) SharePoint (1) Web Development (17) XPage (2) Let's Connect.. Sites I follow The XPages Blog Code Store Ed Brill Archives ► 2010 (13) ► September (9) ► August (1) ► July (1) ► May (1) ► April (1) ► 2009 (53) ► December (2) ► November (2) ► October (4) ► September (7) ► August (8) ► July (7) ► June (6) ► April (2) ► March (3) ► February (4) ► January (8) ▼ 2008 (11) ▼ December (5) Speed up and beautify your web development Ease your lotus web development with Mozilla Fireb... Moving field value to Parent-Child form and vice v... Sappy experience with @For Error Handling in LS , Better way !! ► July (1) ► May (1) ► February (2) ► January (2) ► 2007 (29) ► De