Start a new topic

Error when trying to Initialize a record

The following code give me the error: Object reference not set to an instance of an object.


Public Overrides Sub AfterDictionaries (....)

Dim oRec as Blackbaud.PIA.RE7.BBREAPI.CRecord

Dim oPhone as Blackbaud.PIA.RE7.BBREAPI.CConstitAddressPhone

Dim sConstitID as String = Import.Fields.GetByName("ID").Value

msgbox("ID: " & sConstitID)

oRec.Init(Import.SessionContext)      

msgbox("Record Initialized")

oRec.LoadByField(Blackbaud.PIA.RE7.BBREAPI.bbRECORDUniqueFields.uf_Record_CONSTITUENT_ID, sConstitID)

....

End Sub


I do not understand what is wrong with this code because it works fine in another place in my import profile. Any hint is appreciated.

Thanks.

Philip


You have not created a new CRecord

Dim oRec as New Blackbaud.PIA.RE7.BBREAPI.CRecord
Thank you! That was the problem.
Login or Signup to post a comment