Thanks Ivan, that worked nicely.
I'm still having the same problem as you though, where the attributes in the batch are all empty.
If you put a breakpoint on this line, where the gift is added into the batch:
Code:
Set oTempRecord.DataObject = oGift
It seems that oGift has the attributes set correctly.
But after you get past that line "oTempRecord.DataObject" has lost all the attributes. They are all empty except for the Yes/No fields.
There must be something else that needs to be done to the attribute values before adding the gift to the batch. I've tried:
- setting the attribute values after adding the gift to the batch
- setting the attribute date and comment fields
- setting the attribute import ID to the type ID
- setting the attribute sequence field to different values
- using a transaction around adding the attributes:
Code:
oGift.Attributes.BeginCollectionTransaction
...
oGift.Attributes.CommitCollectionTransaction
Nothing seems to work.
Let me know if you figure it out, I know I can't
