dataClass.get() throws errors but should it?

Just getting started with ORDA so sorry if this is answered somewhere else.

dataClass.get() throws a 4D error dialog if an entity with the given ID doesn’t exist. That is not documented and seems like a bug to me.

After I click continue on the error dialog I get null back as the entity as expected and documented.

Before I file a bug on this one just checking in to see if it is a bug or feature?

Hello Welsh (and welcome to ORDA :-):

If you write this (and only this) will will get an error.
<code 4D>
$entity:=ds.albums.get(999999999)
</code 4D>
(the null value cannot be assigned to destination variable)

Rule : Entities (and entities selections) must me declared as objects

Exemple:
<code 4D>
C_OBJECT($albumSel)
$albumSel:=ds.albums.all()

C_OBJECT($album)
$album:=ds.albums.get(999999999)
</code 4D>

If you do this, you will get a null value for $album.

[]25735174;“No error!”[/]

Hope this helps !

Roland

Of course!

Thank you, makes perfect sense. So excited about ORDA!!