Results 1 to 4 of 4

Thread: Create a import script

  1. #1
    Baldinato is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    23

    Default Create a import script

    Hi to all!!!

    I'm creating a php script to import data from different db to mySQL. I create a part of this script and also i scheduled it. Thanks to all for this. Now i'm trying to add also an email address, but i don't understand the right procedure. I know that all email addresses are stored in the email_addresses table. This table has a primary key in the id field, this id is different respect, for example, the id contacts, presents in the contacts table. I don't understand how to create a procedure to make insert in the contacts table and relative email address in the emailaddresses table.

    Thanks to all

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Create a import script

    Hi, Baldinato

    When inserting a new record that has email (e.g. Contacts) you have to insert a new record in 3 tables:
    Example for Contacts module:

    contacts
    primary key: id
    email_addresses
    primary key: id
    email_addr_bean_rel
    primary key: id
    foreign keys:
    email_address_id: email_addresses.id
    bean_id: contacts.id
    bean_module: Contacts


    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    Baldinato is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    23

    Default Re: Create a import script

    Really thanks for your question.

    I solve the trouble.

    Cheers

  4. #4
    Cypriot is offline Member
    Join Date
    Mar 2010
    Posts
    29

    Default Re: Create a import script

    Quote Originally Posted by Baldinato View Post
    Really thanks for your question.

    I solve the trouble.

    Cheers


    Hi There,
    what is the script that we can use for this please ?

    Regards

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HELP - Act import (field mapping)
    By smelamed in forum Help
    Replies: 32
    Last Post: 2010-12-15, 05:39 PM
  2. Import email attachment - Create Task
    By dgoldwine in forum Help
    Replies: 0
    Last Post: 2008-05-02, 05:24 PM
  3. Import Leads - Create Date Error
    By insyncnet in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-12-04, 09:44 PM
  4. Create Date Import Errors
    By insyncnet in forum Help
    Replies: 2
    Last Post: 2006-08-29, 06:36 PM

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
  •