title: Custom Importer for SugarCRM -- Should I extend or start from scratch?
body: <p>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:</p>
  
  <pre><code>Name  |  Phone Number  |        email  |  date last called |  call notes
    Joe |   555-555-5555 | blah@blah.com |        2011-01-01 | Sounded interested.
  </code></pre>
  
  <p>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.</p>
  
  <p>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.  </p>
  
  <p>If I go with something from scratch the drawbacks are:</p>
  
  <ol>
  <li><p>I repeat a lot of the code already in the import module views (specifically the field mapping and duplicate checking/merging).</p></li>
  <li><p>I have to do it all from scratch.</p></li>
  </ol>
  
  <p>If I try to extend the Import module, I have these issues:</p>
  
  <ol>
  <li><p>I'd have to deal with the lack of xls import support.</p></li>
  <li><p>Since I'm importing to two different modules, some stock parameters (return module, etc) are not clear to me.</p></li>
  <li><p>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.</p></li>
  </ol>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Any advice or warnings are very appreciated.</p>