Anthony
Anthony

Reputation: 37065

Custom Importer for SugarCRM -- Should I extend or start from scratch?

I have a client that wants a custom importer. The data source is an xls file, and the data is a combination of leads and related calls. Something like:

Name  |  Phone Number  |        email  |  date last called |  call notes
  Joe |   555-555-5555 | [email protected] |        2011-01-01 | Sounded interested.

So, for the last two data imports, I added a field called "import_id" with a random guid, saved the file as a csv, imported the leads using the leads importer, exported the leads so I could have the Sugar guid, used Excel to match up the import_id with the Sugar GUID, then imported the calls with the related lead id.

Now the client wants something they can do through the UI. I'm not sure if I should just make something from scratch that emulates the sugar import module, or if I should try to create a custom importer extending the Import module.

If I go with something from scratch the drawbacks are:

  1. I repeat a lot of the code already in the import module views (specifically the field mapping and duplicate checking/merging).

  2. I have to do it all from scratch.

If I try to extend the Import module, I have these issues:

  1. I'd have to deal with the lack of xls import support.

  2. Since I'm importing to two different modules, some stock parameters (return module, etc) are not clear to me.

  3. I'm not sure if it's almost the same as starting from scratch, since I'd be extending the Importer at almost every step.

Basically, I'm not sure if the Import module is really meant to be extended/customized and if this is within the scope of a typical customization, if the idea of importing to two modules from one importer is more trouble than it's worth.

It would be a lot easier to create an entry point that just goes row by row and creates the lead and then the related call via the Bean, but the source data headers are not consistent file to file, so I want to make use of the field map (Step 3) of the Import module.

Any advice or warnings are very appreciated.

Upvotes: 1

Views: 1014

Answers (1)

jmertic
jmertic

Reputation: 2208

The big issue is the requirement of xls support, which would require extensive changes to the Import module to add. If you can have them save the files as CSV, you could probably use the stock import tool out of the box, and add the fields from the related module in as non-db field, and then add a bean method beforeImportSave() to create the needed field in the related module.

You may want to look at tools from Talend as well since they handle this problem very easily, but since you problems are very simple I think you could build a custom view to handle the import file directly.

Upvotes: 1

Related Questions