Results 1 to 2 of 2

Thread: add contacts from a remote script

  1. #1
    blesone is offline Junior Member
    Join Date
    Aug 2006
    Posts
    2

    Default add contacts from a remote script

    hello all,

    i am attempting to add a contact to my sugarCRM database outside of the sugarCRM gui...

    i am able to connect to the database, and all the information seems pretty straight forward... the only thing i dont understand is that the "id" of each entry in the contacts table (inside of mySQL database) looks pretty complex.

    does anyone know a.) why that id is so complex and where its used... and b.) if i just generate a simple id... or change the properties of that mysql field to be an auto_incrementing primary key, will it be okay?

    thanks in advance

    joe

  2. #2
    cywolf's Avatar
    cywolf is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Toronto, Canada
    Posts
    223

    Default Re: add contacts from a remote script

    The ID is generated by the create_guid() function in include/utils.php, and is meant to be unique within the database. I believe this is so that an object can be given an ID before being inserted into the database, instead of having to save the object and then determine what ID it was assigned.

    If you're inserting the data from a PHP script, just include and use the same method to create your IDs. Otherwise it's fine to put whatever ASCII character data you like in there (up to 36 characters), as long as you can generate unique values. But I don't think simply changing the column to an auto-incrementing field would be satisfactory.
    Andrew Whitehead
    The Long Reach Corporation
    http://infoathand.com

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
  •