Hi Trent
The problem is in the _DataLayer_AfterSave event as follows:
For Each record As BusinessLayer In info.BusinessObject.GetEnumerable()
'-- If the fkField is < 0, it needs to be replaced
fkValue = CType(record(info.ForeignKeyField), Long)
If fkValue < 0 Then
record(info.ForeignKeyField) = Me.GetPostSavePrimaryKeyValue(fkValue)
End If
Next
The fkValue of type long will not find a pre-save key value of type decimal.
Most likely the code should read something like as follows:
record(info.ForeignKeyField) = Me.GetPostSavePrimaryKeyValue(record(info.ForeignKeyField))
Hope this helps.