You'll obviously need to have the typical conditionals present so not to assume things exist (e.g. check that a spouse id even exists)
An important thing to note when building IOM customizations that actually interact with RE (as opposed to just manipulating the incoming data) is that you need to learn the RE API and how all of that works. VB is just the vehicle, the RE API is quite unique.
The Blackbaud Knowledgebase actually has quite a few code samples if you look enough and every RE install comes with some API documentation to get you started (C:\Program Files (x86)\Blackbaud\The Raisers Edge 7\Help\RESolutions.chm)
Marissa Roberson
I can provide the pseudo code structure of what we think the API should do (I can also provide the profile mapping if necessary).
I also have a question about if row parsing an import file is possible, kind of like range functions in Excel VBA (selecting a value from an active cell, and performing an If/Else function on a row-by-row basis, etc.). If it is, that would assist in this endeavor tremendously.
~Marissa Roberson
---------------------------------------------------------
--Code (or something resembling code hopefully) Starts Here--
'Import class libraries
Imports Microsoft.VisualBasic
Imports System
Imports System.Linq
Imports Blackbaud.PIA.RE7
'Starts class for IOM Profile
Public Class Profile
'Inherit Profile settings
Inherits ImportOM.API.ProfileBase
[...]
'Find the sub with this first line and copy-&-paste code within the sub
Public Overrides Sub AfterDictionaries(Cancel As ImportOM.API.iCancel)
Dim strSpouseID As String 'This is what we want to add; Append from RE to the ID column
'Existing values from Send Appeal Excel File
Dim strConstID As String '"ID"/"A". This is the primary constituent's unique ID
Dim strAppeal As String '"Appeal"/"B".This is the appeal ID
'Dim strPackage as String '"Package"/"C". This is the package the appeal is attached to.
Dim dtmDateAdd As Date '"Date"/"D". This is the date of the appeal
Dim strNextConstID As String '??
'Get values (not sure if I should use Excel name or profile name for import data
'strConstID = Import.Fields.GetByName("ID").Value
strConstID = Import.Fields.GetByExcelName("A").Value
'strAppeal = Import.Fields.GetByName("Appeal").Value
strAppeal = Import.Fields.GetByExcelName("B").Value
'dtmDateAdd = Import.Fields.GetByName("Date").Value
dtmDateAdd = Import.Fields.GetByExcelName("C").Value
'Find Spouse IDs
For each strConstID
'Check each constituent ID
'Check for Spouse Record
If oInd.Fields(INDIVIDUAL_fld_IS_SPOUSE) = True Then
'Check for Spouse Constituent ID (NOT Spouse Relation ID!)
If object.Spouse.Fields(INDIVIDUAL_fld_CONSTITUENT_ID) "" Then
'Set to SpouseID
object.Spouse.Fields(INDIVIDUAL_fld_CONSTITUENT_ID) = strSpouseID
'Find last row & Append SpouseID to ID field
[...]
Else If object.Spouse.Fields(INDIVIDUAL_fld_CONSTITUENT_ID) = "" Then
End If
End If
Next strConstID
End Sub
[...]
End Class
----------------------------------------------------