Welcome to the #dominoforever Product Ideas Forum! The place where you can submit product ideas and enhancement request. We encourage you to participate by voting on, commenting on, and creating new ideas. All new ideas will be evaluated by HCL Product Management & Engineering teams, and the next steps will be communicated. While not all submitted ideas will be executed upon, community feedback will play a key role in influencing which ideas are and when they will be implemented.
In Notes Version 14.5.1 there is ne New parameter [SuppressErrors]:
Set el = obj.Getelementbyname("name", true) -> No Error when there ist no Element "name". Returns Nothing.
I have not testet yet, not all users habvv 14.5.1 yet. As workoraund I have a function:
'/**
' * Gibt das JSON-Element <strKey> des JSON-Objekts zurueck.
' * Wird benoetigt bis der Server den Paramater True bei jsnObject.Getelementbyname beruecksichtigt.
' * @param jsnObject JSON-Objekt dessen JSON-Element zurueckgegeben werden soll.
' * @param strKey Schluessel des JSON-Elements im JSON-Objekt das zurueckgegeben werden soll.
' * @return JSON-Element oder Nothing bei Fehler 4843.
' * @author sk
' * @version 2026-05-18
' */
Private Function getJsnElementByNameInJsnObject(jsnObject As NotesJSONObject, strKey As String) As NotesJSONElement
On Error GoTo ERROR_HANDLING
On Error 4843 GoTo EMPTY_OBJECT
Set getJsnElementByNameInJsnObject = jsnObject.Getelementbyname(strKey)
Exit Function ' getJsnElementByNameInJsnObject
ERROR_HANDLING:
Set getJsnElementByNameInJsnObject = Nothing
Dim eeThis As New ErrorEntry(DESIGN_AGENT, "PDAAPI/saveProjectTasks")
Call eeThis.raiseError("", Nothing)
Exit Function ' getJsnElementByNameInJsnObject
EMPTY_OBJECT:
Set getJsnElementByNameInJsnObject = Nothing
Exit Function ' getJsnElementByNameInJsnObject
End Function ' getJsnElementByNameInJsnObject
Yes, having to build in work funky error handling etc. to do this is counter intuitive. This would save developers so much time.