When importing addresses I have written code so that, before a constituent save, each of the constituent's addresses are checked for certain criteria. If it meets this criteria I want to add a NEW attribute to that address.
I assume I can use .Attributes.Add but I am unsure how. Am I able to create a new attribute, define it's category, description and date, then add it to an address?
With oAddress.Attributes.Add() .Fields(EattributeFields.Attribute_fld_ATTRIBUTETYPES_ID) = [Attribute Category] .Fields(EattributeFields.Attribute_fld_VALUE) = [Attribute Description] .Fields(EattributeFields.Attribute_fld_ATTRIBUTEDATE) = [Attribute Date] End With
This assumes you have the following line at the top of your code: Imports Blackbaud.PIA.RE7.BBREAPI
If you need to find the attribute type id then you will have to load up an AttributeTypesServer
P
Peter Ennals
said
over 8 years ago
Thanks, that worked perfectly.
Rather than matching the category to the AttributeTypesServer I was lazy. To find out the attribute type ID I added the attribute I wanted, to a test record, with a comment and iterated through the attributes returning the ID and comment.
W
Wayne Pozzar
said
over 8 years ago
Awesome!
This helps too if you have access to the RE Database
Peter Ennals
When importing addresses I have written code so that, before a constituent save, each of the constituent's addresses are checked for certain criteria. If it meets this criteria I want to add a NEW attribute to that address.
I assume I can use .Attributes.Add but I am unsure how. Am I able to create a new attribute, define it's category, description and date, then add it to an address?
Thanks
Pete