Results 1 to 6 of 6

Thread: Making the accounts field into an auto_increment

  1. #1
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Unhappy Making the accounts field into an auto_increment

    Good evening Peeps

    Another naggy problem on my sugar road. I must make the accounts.id field into and auto increment. I'm using 5.2ce on a linux box

    Regards

    John

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Making the accounts field into an auto_increment

    You'd have to do this via the backend.

    See here:

    http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

    and here:

    http://dev.mysql.com/doc/refman/5.0/...increment.html

    Out of curiosity, why are you doing this? This can cause problems if you to sync the data in the future.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Smile Re: Making the accounts field into an auto_increment

    Hi Angel

    Its not necessarily what i want to do, however we are linking data via MySQL views and the table that we are viewing uses auto increment integers. The problem is if we use random numbers it could break other applications linked to the database, so its the better of two evils to change sugar . But hey thanks for the tip, i will post my project for the community once i've finished or committed suicide, whichever comes first.

    regards

    John

  4. #4
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Red face Re: Making the accounts field into an auto_increment

    Hi Angel

    The links that were in your last posting on this topic refer to changing the database, the database i'm linking to already has an auto increment as its id. what I actually want to do is turn off the id creation so that this database can populate its own id, any ideas?

    Regards

    John

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Making the accounts field into an auto_increment

    Well, I can only answer based on the information provided.

    At some point you'll need to alter the accounts table in order to make the ID column auto_increment, hence my prior references.

    In order to keep it from creating ID values, you'd most likely have to change the save() function in SugarBean.php, which wouldn't be upgrade safe.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  6. #6
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Smile Re: Making the accounts field into an auto_increment

    Quote Originally Posted by Angel View Post
    Well, I can only answer based on the information provided.

    At some point you'll need to alter the accounts table in order to make the ID column auto_increment, hence my prior references.

    In order to keep it from creating ID values, you'd most likely have to change the save() function in SugarBean.php, which wouldn't be upgrade safe.
    Your right Angel it does help to have the info , will look into that and with a bit of luck it will serve my purposes.

    Many thanks

    John

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 13
    Last Post: 2010-12-03, 11:17 AM
  2. Making a field read only - editview
    By dusker in forum Help
    Replies: 8
    Last Post: 2009-11-06, 08:47 PM
  3. Making fields as a required field
    By dinudanial in forum Developer Help
    Replies: 3
    Last Post: 2009-04-03, 05:12 AM
  4. Replies: 7
    Last Post: 2007-07-13, 01:38 PM
  5. Making custom field searchabe
    By magick727 in forum Developer Help
    Replies: 0
    Last Post: 2005-10-05, 03:40 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
  •