Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Setting custom Integer Field Default Values to Zero

  1. #1
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Setting custom Integer Field Default Values to Zero

    Hi.
    I've set up a number of custom integer fields that I use in auto-calculations. In Studio, typing a '0' in the default value field does not save. It accepts the entry, but when opened again, the default value is blank. Even setting the default value to zero in MYSQL doesn't work...when a new record is created, the field values are null. Is there a workaround for this bug???? somewhere to set default value to zero in the .php code?
    Thanks.

  2. #2
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    follow up is that I tried to manually set to zero in opportunitiesvardefs.php by changing 'defaultvalue' ==> NULL to 'defaultvalue' ==> '0', then running repair & rebuild on Opportunities...again to no avail. Seems like a bug, is there a fix out there? Having trouble finding it in the bugtracker...
    THANKS!

  3. #3
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    follow-up 2: in above, defaultvalue is actually default_value. I also changed default ==> null to default ==> zero, not sure what the difference is between default_value and default...only integer type fields seem to have both options, custom decimal fields only have default (not default_value). Anyways, even setting both to '0', saving the php file, running repair and rebuild on opportunities doesn't make a lick of difference. Any advice? Its killing the auto-calculation field by requiring the user to manually enter a zero in several different fields to get a value...
    THANKS!

  4. #4
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    Anyone have any suggestions on this?

    Very frustrating problem. Every week when I run a sales pipeline report, I have to go in and manually insert zeros in fields for new opportunities so that my auto-calculations work properly.

    Crazy that Sugar is overriding MYSQL in this case, where a description of the table CLEARLY shows default value of zero, but it just won't take in the studio...so I'm getting all these NULL values where NULL values shouldn't be a possibility.

    Thanks in advance for your advice.

  5. #5
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    Follow-up to this is that the upgrade to from 5.0.0f to 5.2 corrected this bug.

    PROBLEM SOLVED...if anyone is interested...

  6. #6
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    D'OHHHHH!!!
    I spoke too soon.
    While its true that I am now allowed to both enter AND save a zero in the Default Value field for my custom integer fields, those zeros do not actually show up when creating a new record and are still null values in the database.
    I ran a repair and rebuild on Opportunity after saving the zeros as default values but this did not make a difference.
    HELP ME PLEASE!!!! THIS IS KILLING ME!!!!:ee
    k:

  7. #7
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Default Re: Setting custom Integer Field Default Values to Zero

    You said that Sugar is overriding your database value - can you verify that MySQL is accepting 0 for that field? Can you change it in the database?


    Also, did you upgrade over the weekend? I just spoke with Ken Brill on the issue we were talking about Friday, and he says that custom module relationships were not working correctly in 5.0.0*.
    Last edited by lowJack01; 2009-01-19 at 06:35 PM.
    Thank you,

    Jackie Trent
    Independent Contractor
    Sugar - 5.0.0d, 5.0.0f
    PHP Version 5.1.6
    MySQL 5.0.58

  8. #8
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    Well, that seemed to be what was happening initially. In 5.0.0f, I couldn't save the default value of zero...everytime I clicked save (this is in the admin area), i would look again and the default value field would be blank again.

    I DID upgrade this weekend, and it went so smoothly I could hardly stop patting myself on the back. Now the default values of zero WERE saving in the admin area...but this didn't really seem to affect the actual values that would come up when creating a new record. All fields for which the default value should have been zero were just blank...and they appear as "null" in the database, even though default appears as zero when I look at the table in MYSQL...

    RE: the upgrade...i made a small studio modification in relationships this morning and brought the whole thing to its knees...oops. More soon after I downgrade and try again...

  9. #9
    lowJack01 is offline Sugar Community Member
    Join Date
    Sep 2007
    Location
    Albuquerque, NM
    Posts
    86

    Default Re: Setting custom Integer Field Default Values to Zero

    Danheff:

    Default 0:
    Do you have direct access to the database, either through phpMyAdmin or command line? My thought is that you can set the default value in MySQL and set the field to NOT NULL and see what happens. Does it solve your problem, or does it make it worse?

    Upgrade:
    Ouch! I'm sorry to hear that. Good Luck! What sort of modification was it?
    Thank you,

    Jackie Trent
    Independent Contractor
    Sugar - 5.0.0d, 5.0.0f
    PHP Version 5.1.6
    MySQL 5.0.58

  10. #10
    danheff is offline Senior Member
    Join Date
    Aug 2008
    Posts
    90

    Default Re: Setting custom Integer Field Default Values to Zero

    well, it appears to be a bug.

    The surprising workaround: In Studio, type in TWO zeros in the default value field and Save.. Then zeros show up upon creation of a new record.

    HA!!!


Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2008-12-08, 11:20 PM
  2. Custom fields: non-NULL default values?
    By sunside in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2008-09-22, 08:47 AM
  3. Replies: 3
    Last Post: 2008-06-27, 10:16 AM
  4. Custom Field integer
    By adam.c in forum Help
    Replies: 1
    Last Post: 2007-11-13, 09:05 PM
  5. Replies: 1
    Last Post: 2007-01-31, 09:44 AM

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
  •