Start a new topic

Record Added vs. Modified

Is there a way for me to know whether a constituent (or relationship) was added on the row vs. just matched/edited?

The issue I am looking at is setting the Addr/Sal conditionally for new records (based on Title, Spouse, suffix, etc.) but leaving existing records alone because they might have been set non-standard manually for a special reason.

With addresses I can use the "AddressAdded" sub but there doesn't seem to be one for constituents or relationships.


Hi Wayne,

You are correct that there is not a sub you can use for the Add/Sal.

If all of the incoming records are to use the same Add/Sal formula in RE, then you could specify it in a Constituent Default Set and then choose that Set in the Defaults section of the IOM profile. Default Sets only apply to NEW constituents. They do not apply to relationships, though, even if those relationships get created as a full constituents during the import.

If that won't work, you could try checking for the Constituent ID to not be valid, but that will only work for Constituents, not relationships.

Hope that helps,

Tiffany

Thanks Tiffany,

I think what I am going to do is make a new Salutation in RE called "IOM_NEW_RECORD" that I assign as the default in my IOM profile(s). Then, in the API I will check for the addr/sal to be set to that in the BeforeRowCommit sub and change them there.

It's not great but it's what I have!

I would still like to have an easy way to know if a constituent was added or modified so that I could conditionally add a note/attribute to the record as a timestamp of when they were last updated automatically and what I changed.

Alas I shall have to wait on that one I think.
I'm having a similar issue with solicit codes, with the added complication that I only want to add a certain solicit code if both of the following are true:

a) they are new constituents, AND
b) if they have a value of 0 in column O of the file I'm importing.

Otherwise, I don't want to add any solicit code.

At the moment, the solciit code is going onto the records of anyone with 0 in column O, regardless of whether they are new. This is being done in the import profile, with the help of a dictionary. Would it work if I created two individual default sets, one with the solicit code and one without, and used the API to tell IOM which default set to use, based on the value in column O?

Or is there any other way (with or without API) that I could achieve the same effect?

Thanks!
P.S. I'm new to API, so it's very possible that the answer is already in Wayne and Tiffany's posts and is just going straight over my head...
I'm not sure that you can switch default sets on the fly in an IOM profile but I bet there is a way to apply them through the RE API. Very interesting idea, any hints on that Nic/Jeff?
It is certainly possible to apply default sets with the API. However the library required isn't referenced by the API so it would need to be done using late binding. The library is Blackbaud.PIA.RE7.DefaultsData7 and the type is CFieldDefaultServer. You have two options. You can load the .NET interop assembly provided in the PIA folder or you can use the COM library that is registered in the GAC using the CreateObject method. The CreateObject method is simpler.

Dim DefaultServer = CreateObject("DefaultsData7.CFieldDefaultServer")
DefaultServer.Init(Import.SessionContext)
DefaultServer.LoadDataObjectWithDefaults(oRec,Default Set ID, True/False(if you do not want the default set to override fields already filled out))
DefaultServer.CloseDown()
DefaultServer = Nothing
Nic the magician!
Login or Signup to post a comment