Start a new topic

How to conditionally ignore a field

I am new to IMO. My intention is to use it to integrate our current production and input lines seamlessly with RE. I am using IOM to import all our gifts into different RE batches. I have an existing MS Access data base to pre-process donations. Access exports the data into a csv file so that IOM can pick it up.

Some of the gifts are paying for memberships. In this case access provides all the data needed to issue/renew/upgrade the membership. This means that some records contain the membership info and some don't. I mapped it all in my profile but when I try to import the data I get exceptions that the membership could not be matched.

I think I could avoid this error if I can somehow tell IOM to ignore empty membership fields and only import the gift info and possibly constit info as needed.

Is there a simple way of doing it this?

Regards,

Philip


Hi Philip,

You should not be receiving any error messages about membership if all the the membership fields are truly left empty, can you double check? If you want to blank out somecolumns automatically, you could certainly do something like this:

    Public Overrides Sub BeforeDictionaries(Cancel as ImportOM.API.iCancel)
        Import.Fields.GetByName("SomeMembershipColumn").Value = ""
    End Sub

Let us know what you find. 

Thanks,

Jeff

Hi Jeff,

Thanks! That solved the problem. I had a '0' in a field. Everything else was blank. After deleting the zeros it was importing without errors.

But just for curiosity is there a way to ignore a field based on a condition?

Regards,
Philip
Hi Philip,

The way to ignore it would be to blank it out. If you can give me an example of the condition I might be able to write a code snippet that demonstrates how to blank out a field conditionally.

Thanks,
Jeff
Thank you.

I was thinking about setting the RecordType to Ignore:

[code] If _____ = True Then Import.fields.getbyname("Field").RecordType = RecordType_Ignore Else End If [/code]

But it seems like that the Record type property is read only unless I'm missing something.

However if the way to ignore a field is to leave it or make it blank than that is the easier option.

Thanks.

Philip
Login or Signup to post a comment