Start a new topic

Individual Relationships with/without last names

I am importing a list of constituents with individual relationships (some of them don't have individual relationships, some have). Some of the individual relationships have last names, some don't. I want whose without last names to be imported with last name "LNU", but those that have last names to keep them. How can I do it?

P.S. I've created a dictionary to change blank last names to "LNU", but now the system creates Individual relationship with last name "LNU" even if a constituent doesn't have any individual relationship.

1 Comment

I think you will probably have to use a custom function for this.  The code would look like:

' set the return value to the current Last Name value

sReturn = oField.Value ' Check if the First Name value is blank If Import.Fields.GetByName("First Name").Value  "" Then 	' If the First Name value is NOT blank then check the Last Name 	If sReturn = "" Then 		' If the Last Name is blank then make it "LNU" 		sReturn = "LNU" 	End If End If  
The logic here is:
If the First Name is blank then don't change anything, otherwise (if the First Name is NOT blank) check the Last Name to see if it is blank.  If the Last Name is blank AND the First Name is NOT blank then set the Last Name to LNU, otherwise just leave the Last Name.
Login or Signup to post a comment