Hi Wayne
I don't visit here often, so you may have solved this by now. I tried your code and it worked fine (I just added actual error text for clarity).
Obviously I did get an error because in this test I'd mapped the lookup to the RE importID: "Source row 1 produced Excel error row 2: No record could be found for the specified ID or alias: 'went to error handler'. "
But that occurs after the "afterdictionaries" so it's not the code. What error are you getting?
Cheers
Nick
Wayne Cox
Is it possible to trap errors in Omatic code by use of On Error GoTo or Try Catch Finally? I have tried both but it doesn't seem to trap my error. I am loading an RE record in the omatic code to get the ImportID of the constituent. When I load with an existing System Record ID it returns the ImportId, but when I load with an invalid System Record ID, the omatic import errors out but doesn't trap my error (I am trying to have it return empty string if it can't find the record in RE). Here is my code (i also tried with Try Catch Finally but the same thing happens.
<ImportOM.API.VirtualColumn("GetImportID")> _
Public Function ComputedColumn_637602077371380417( _
ByVal oField as ImportOM.API.iField, _
ByVal Cancel As ImportOM.API.iCancel) As String
'This function must return a text value
Dim sReturn As String
Dim oRec As Blackbaud.PIA.RE7.BBREAPI.CRecord
oRec = New Blackbaud.PIA.RE7.BBREAPI.CRecord
oRec.Init(Import.SessionContext)
On Error GoTo Errorhandler
oRec.Load(oField.Value)
sReturn = oRec.Fields(Blackbaud.PIA.RE7.BBREAPI.ERECORDSFields.RECORDS_fld_IMPORT_ID)
On Error GoTo 0
oRec.CloseDown()
oRec = Nothing
Return sReturn
Exit Function
Errorhandler:
sReturn = ""
'Dim sReturn As String = "Return value"
Return sReturn
End Function