Remove Err=4091 from GetDocumentByUNID method 
Use this IdeaSpace to post ideas about Domino Designer.

: 23
: 24
: 1
: Domino Designer
: NotesDatabase, GetDocumentByUNID, Err, error, 4091, lotusscript, java
: Vlad Sh10679 25 Nov 2009
: / Email
Generation of this error is useless, it only hinders. Quite enough to return Nothing.
Similar GetDocumentByID method does not generate errors.

1) Kenneth Axi2537 (04 Aug 2011)
No, I don't agree. There is a perfect valid reason for the GetDocumentByUNID to raise an error when You supply an UNID that is not present in the database. You as a programmer EXPECT that the function will return a NotesDocument object. It should not be allowed to return Nothing since that will break OOP standards.

The thing is what should be changed is the errorhandling of LotusScript. If errorhandling where done in more OOP way, then this issue wouldn't be any problem.

I would like to see a try...catch...finally block introduced in LS so that errorhandling can be done as we do it in Java.
2) Andrew Magerman54 (01 Nov 2013)
@Kenneth : what do you mean, returning Nothing breaks OOP standards?

If what you say is correct, then we should also throw errors whenever we do a .getAgent(), .getView(), etc. getDocumentByUNID is the only one whose API is not consistent with the other 'gets' in LS and Java. It's a right pain in the arse, and I always have to program a mini-function with Error handling within it.


Welcome to IdeaJam

You can run IdeaJam™ in your company. It's easy to install, setup and customize. Your employees, partners and customers will immediately see results.

Use IdeaJam to:

  • Collect ideas from employees
  • Solicit feedback and suggestions from employees and customers
  • Run innovation contests and competitions
  • Validate concepts
  • Use the power of "crowd-sourcing" to rank ideas and allow the best ideas to rise to the top

IdeaJam™ works with:

  • IBM Connections
  • IBM Lotus Quickr
  • Blogs and Wikis
  • Websphere Portal
  • Microsoft Sharepoint
  • and other applications.

IdeaJam has an extensive set of widgets and API's that allow you to extend and integrate IdeaJam™ with other applications.

Learn more about IdeaJam >>

IdeaJam developed by

Elguji Software Logo