Open main menu

Importing contacts

Revision as of 20:49, 3 June 2008 by Freephile (talk | contribs) (interim draft)

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

First I downloaded the source

  1. I went to the SugarCRM homepage, and clicked the top navbar link to "Sugar Open Source"
  2. I skipped the "Wizard" and went right to the "Download Page" because I know what I'm doing and also have a pre-existing setup of Linux, Apache MySQL and PHP - so I only want the app
  3. I downloaded SugarCE-5.0.0e.zip (production release)
  4. I visited the recommended "Installation" instructions page at http://www.sugarforge.org/content/installation/
  5. Then I installed it according to the instructions, however I immediately ran into trouble because the instructions did say to chmod 766 all files that needed to be writable by the web_user.
  6. This command renders the directories non-executable which manifests in include errors because the web user (www-data) can not see into those directories (to find includes).
# find directories in the ./crm path and change the mode on them so that all users can execute (see into) the directory 
find ./crm/ -type d |xargs chmod a+x

resolved the include errors

Ideas on How to do the import

Existing Work

My first instinct was to find info about somebody doing this before (e.g. APIs, Documentation, forum questions, Wikis)

I searched the wiki for importing or APIs and quickly found the SOAP Intro and Practical Examples, so I figured I was onto a fast track. However, the soap example worked with a frontend form which wasn't explained much and so I looked more into what was required. When I found the form in "examples", it did not work as an application entry point (because even though it defined ('sugarEntry', true); there was also an IF that pre-empted that definition) Not immediately seeing this cause for the example failure, I put the example form outside the application directory and then used the form to insert a single lead http://www.sugarcrm.com/wiki/index.php?title=Creating_a_lead_capture_form_for_your_website Seeing that the example worked, but did not capture all the details provided in the data exercise, I knew I should look at the existing functionality of modules/Lead and/or the database to get a clear picture of what I needed to label everything.

Use the Source Luke

My second instinct was to look at the source. Answers are always found in the source, with the caveat that it can be confusing and/or time-consuming to find those answers. Looking at the full application import routines and the four-step forms for importing leads, it was clear that there was a lot of machinery that I didn't need or want to get involved with to simply import records. I decided to go back to the SOAP example and write a scipt to read the exercise data and create full records for the 50 provided leads.

I looked at the config.php to get

Soap examples seemed to have changed with the addition of a version number

"Import Step 2: Upload Export File" is a confusing title on the second step of the "Import Contacts" wizard.  It could read "Import Step 2: Specify Data File to load"


Typographical bug: I saw that the term "custom_delimeted" is used in a self-contained way in

./modules/Import/language/en_us.lang.php
./modules/Import/ImportStep1.html
./modules/Import/ImportStep2.php

This term is used elsewhere spelled correctly, and thus could potentially lead to a bug down the line.