Access of shared member, constant member, enum member or nested type through an instance

Hi.

I'm trying to insert a value on AADUser.OnPremImmutableId and I get this error:

WARNING: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated., Script: Tmpl_AADUser_OnPremImmutableId, Line: 1542, Script Line: 4

This is the line of code:

Dim f As ISqlFormatter = Connection.SqlFormatter
Dim ADSAccountGuid As String = Connection.GetSingleProperty("ADSAccount", "ObjectGUID", f.UidComparison("UID_Person", $UID_Person$))
Dim ObjectGuid As Guid = ObjectGuid.Parse(ADSAccountGuid)
Dim OnPremImmutableId As String = Convert.ToBase64String(ObjectGuid.ToByteArray)

Value = OnPremImmutableId

Anyone got any clues?

/Henrik

PS. Running 8.1.3

Parents
  • Here's how I solved it:

    Dim f As ISqlFormatter = Session.SqlFormatter
    Dim where As String = f.UidComparison("UID_Person", $UID_Person$)
    Dim ADSAccountGuid As String = ""
    
    If Session.Source.TryGetSingleValue(Of String)("ADSAccount", "ObjectGUID", where, ADSAccountGuid) Then
    	Dim GuidByte() As Byte = System.Text.Encoding.UTF8.GetBytes(ADSAccountGuid)
    	Dim OnPremImmutableId As String = Convert.ToBase64String(GuidByte)
    
    	Value = OnPremImmutableId
    Else
    	Throw New ViException
    End If

Reply
  • Here's how I solved it:

    Dim f As ISqlFormatter = Session.SqlFormatter
    Dim where As String = f.UidComparison("UID_Person", $UID_Person$)
    Dim ADSAccountGuid As String = ""
    
    If Session.Source.TryGetSingleValue(Of String)("ADSAccount", "ObjectGUID", where, ADSAccountGuid) Then
    	Dim GuidByte() As Byte = System.Text.Encoding.UTF8.GetBytes(ADSAccountGuid)
    	Dim OnPremImmutableId As String = Convert.ToBase64String(GuidByte)
    
    	Value = OnPremImmutableId
    Else
    	Throw New ViException
    End If

Children