Results 1 to 6 of 6

Thread: Newbie - data import question

  1. #1
    tomred is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Newbie - data import question

    I should say in my first post, thanx Sugar team for the excellent package.


    Sugar V4.2.1
    I want to import some contact data into my vanilla system. First time round I used the import button from the contact page. I used custom-tab but this seemed to limit the number of field mappings to 7 and I had more fields then that. I could presumably use the custom mapping but I can't find any information about that.

    What I'd prefer is to do a direct mysql LOAD from file into the sugarcrm contacts table. To do that I need to know how the ID field is generated. It's a 36 characer varchar type and looks something like "95337c27-92bd-7069-6041-44e44478e646". Is there somewhere I get some code to allow me to generate these ID's?

    Thanks in advance.

  2. #2
    Scott_Savage is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Sydney, Australia
    Posts
    193

    Default Re: Newbie - data import question

    The best way that I found to have this code generated for you was to use the SOAP interface. This way you do a set_entry call and then enter all the fields you want (except the id field, which is auto-generated).

  3. #3
    tomred is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Re: Newbie - data import question

    I am not familar with SOAP hence the use of LOAD. If you could point me to some more detailed info on accessing the set_entry call that might be helpful. I am more familar with perl but I am sure I can find a hack for it.

    Are ID numbers auto-generated when using the set_entry call only? I have tried to load a file with an empty first field but mysql barffed with "ERROR 1062 (23000): Duplicate entry '' for key 1". So are you saying that avanue is closed to me unless I generate them myself or from what you say use SOAP?

    TIA.

  4. #4
    Barakanooz is offline Sugar Community Member
    Join Date
    May 2006
    Posts
    26

    Default Re: Newbie - data import question


  5. #5
    tomred is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Re: Newbie - data import question

    Well that looks like it would do the job however it says:

    FUNCTIONS, STORED PROCEDURES AND TRIGGERS are only available in MySQL 5.0. So, no way of using with previous versions.

    The version of Sugar I downloaded (Version 4.2.1a) was the bitrock linux installer and comes with mysql V4.1.18-standard.

    I will burn it, install all mysql/php and use the other installer.

    I would still be greatful it there were sample code on how to use SOAP/set_entry.

    Thanx again.

  6. #6
    tomred is offline Member
    Join Date
    Aug 2006
    Posts
    6

    Default Re: Newbie - data import question

    One last point:

    Managed to get some perl SOAP going to create_contact thanx to a post by CTooley. The create_contact facility is limited to first_name, last_name and email1. If you have thousands of records to import and more than 7 fields per client, the best route would probably be via a MYSQL load and the FUNCTIONs described at http://www.sugarcrm.com/forums/showthread.php?t=2895


    ======== Totally unsafe create contact perl sample =========
    use sugarsoap;
    use Digest::MD5 qw(md5 md5_hex md5_base64);
    use Data::Dumper;

    use constant SUGAR_USER => 'admin';
    use constant SUGAR_PASSWD => 'foobar';

    my $service = new sugarsoap;

    my $pass = md5_hex(SUGAR_PASSWD);
    my $u = $service->create_contact(SUGAR_USER,$pass,'tomred','dubious ','spamme@yourdomain.net');
    print "\n\n";
    print Dumper($u);
    ================================================== ==

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •