Skip to main content

As part of our implementation, we will be getting XML file from Bank which will be processed using Middleware and created as staging record in Salesforce for further processing using Batch Class.

As part of the Batch Class, we have to identify existing contact based on IBAN (like Bank Account Number). A Contact can have multiple IBAN associated with it (max 4 IBAN per contact). We are thinking of below 2 options to implement it.

 

1. Create 4 fields (IBAN1, IBAN2, IBAN3, IBAN4) on Contact record to capture IBAN and make these custom fields as external. Add query in our Batch apex to check for existing contact with matching IBAN based on these 4 IBAN custom fields (like Select id from Contact where IBAN1 = 'XYZ1" or  IBAN2 = 'XYZ1" or IBAN3 = 'XYZ1" or IBAN4 = 'XYZ1" limit 1) or. If Contact found then create Opportunity.

 

2. Option 2 is to maintain a new Object with details of each IBAN wrt. to each donor. Then in Batch class query IBAN object and search for IBAN record with matching IBAN. If found an IBAn record then tag contact id from IBAN record and create Opportunity under that contact.

 

In both options we have add additional logic to keep on updating contact or creating IBAN record based on new IBAN wrt to contact.

 

I want suggestion from the group which option is best suited in terms of best practices, considering we have 1 million contact records. If you can suggest any other option that will be great as well.

 

Thanks in advance.!

 

#Trailhead Challenges #Best Practices @Nonprofit Success Pack 

2 answers
0/9000