2

I'm gonna try to keep this question from not being a discussion subject, as well as I can.

The scenario I'm facing is that I have a system with multiple third party integrations which requests data from web services. This involves in main part Account infromation which should be added into my system. Since this is done dynamically I cannot use an initial loading or something like that to load the information into the system.

So from one system I might get First Name, Last Name, Birthdate, Street Address, City, Zip code. And from another system I might get Name (as "Last Name, First Name"), Street Address (as "StreetX, City, Zip"). I need to add these Accounts into SF as Account Objects. If everyone would be unique the issue would be solved but a User can request a call that gets information that is acctually represented as an Account, so there is a need to first search the accounts in SF and try to find a matching account (and hence update that one instead of creating a new).

I have a solution that works OK, basicaly what I do is a lot of queries using the available input parameters and successive try to find a single match. If I however cannot refine my search anymore and is left with >1 possible Accounts I present this list for the User and lets her select manually.

Since this is a pretty messy class, even if I have full coverage, is there anything out there that could ease up this and create a more maintainable code? Has anyone else had this issue and found a clean solution to it?

  • Post some code please. – Adrian Larson Feb 10 '15 at 21:49
  • My question does not regard my code per se, I'm looking for a new way of handling this. Since I stated that the class that handles this is messy and is basically structured with a lot of queries followed by if statements to check how many accounts was returned with the provided parameters. What I am looking for is a new way of handling this, preferably anew way of thinking instead of query, check number of results, refine search if more than one result, query, check number of results, return if we cannot refine anymore. – erikduvet Feb 11 '15 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.