2

I am new to Force.com and Salesforce in general and am looking for assistance with a client requirement.

On a regular basis, they receive an excel sheet from a partner listing new customers that have joined their subscription program. These customer lists contain contacts in three categories:

  • already in Salesforce as a LEAD (matched on email or name) and need to be converted to Account/Contact
  • no matching Lead or Account/Contact, so require a new Account/Contact to be created
  • already added to SF as an Account/Contact, so should be ignored

My instinct is to create a web application that uses the Force API to do all the required matching and creation. Is this the best way forward? Should I be using the Apex platform instead? Is there any existing tools which would enable this functionality?

1
3

Web Application and Heroku Option

You could create a Web Application, perhaps using the Salesforce Heroku platform to host it, whereby you have a number of languages to choose from. There is a number of toolkits to help utilise the Force API's to access data in Salesforce from such environments, a good starting point Integration Workbook.

Force.com Platform Option

If you want to keep it native this is also possible. It is indeed possible to parse CSV files on the platform there is a number of online resources that provide libraries to do this, though it means you have to get more advanced into Force.com programming and its UI technology known as Visualforce to upload. You will also have to give more consideration to volumes if you handle the CSV loading yourself.

A route worth considering is to utilise as much of the platform tools to get the data into a table (referred to as an Custom Object in Force.com) and then process that using the native Database query and manipulation constructs in the platform via its Apex language. Here is what I would do...

  • Create Custom Object that maps precisely the field names of the incoming CSV file. This will help ensure you get the most out of the default mapping in the next step.
  • Utilise the one of the Data Loaders on the platform, the latest and most friendly in my view is the Data Import Wizard. After this process this also allows the user via the standard Salesforce UI to review and modify the data if needed before processing.
  • Develop a List Custom Button on the Custom Object that invokes some Apex code query the records and process them according to your rules. Clearing the records out when done or leaving records not processed in place for review and retry.

enter image description here

enter image description here

NOTE: If your volumes grow, by the sounds of your logic, you'd probably get several thousand records processed in the interactive Apex context. Beyond that you would have to adapt your logic to Batch Apex, if you study now how that works you can ensure your code is read to work in this environment if you need to scale.

1
  • This points me in the right direction. Thanks for the detailed answer – Andre Lackmann Oct 9 '13 at 4:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.