In Identity Manager 6.X you might have been accustomed to use the method below to get a value for a specific property:
Connection.GetSingleProperty(<tablename>, <columnname>, <whereclause>)
This method returns an empty string if an object for the given 'whereclause' could not be found.
But with the release of version 7.0 a new object layer API has been introduced and the recommendation is, to use the method below from now on:
Session.Source.GetSingleValue(Of String)(<tablename>, <columnname>, <whereclause>)
But this method returns an exception if an object for the given 'whereclause' does not exist.
This new behaviour is expected.
You can still use the old method (Connection.GetSingleProperty()) in D1IM 7, but this is only a compatibility-proxy which points to this code:
Session.Source().TryGetSingleValue(<tablename>, <columnname>, <whereclause>, out value);
Or you can use, if you want to use the methods of the API v7, use Session.Source().TryGetSingleValue():
Dim xValue As String
If (Session.Source().TryGetSingleValue(Of String)("<tablename>", "<columnname>", "<whereclause>", xValue)) Then
'work with xValue
'Else 'make something different
Such changes are always unpopular with developers, but we had good reasons for that change:
In version 6 you had to evaluate if the result is the default value(String “”, Integer 0, bool false. That was extremely difficult to differentiate, because the method posed to be run successfully.
In version 7 you can catch the exception in the script and react in the error section appropriately, or you use the try version, which results in true if successfully and assigns a value to the out variable.