Get a Jumpstart with our Sample Apps
Results 1 to 8 of 8

Thread: gen_ledg_xact Auto-increment field not starting from Simple default expression

  1. #1
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    379

    Default gen_ledg_xact Auto-increment field not starting from Simple default expression

    Hi there,

    I Have a Table 'gen_ledg_xact' in which i have a field Gx_Idf Numeric. This has been set to start at a default expressing of 1.

    Keeps starting at 0 !

    Can you spot what I am doing or not doing ?

    Looking forward
    Attached Images Attached Images
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,696

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    The docs do say to set the skip to true but I doubt that's the problem.

    Do you have the same issue if you create a new table and make a field auto-increment? If you compact the database? If you reboot the machine?
    There can be only one.

  3. #3
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,382

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    How are you adding new records?

    Can you post a sample of the table and the steps you are using?
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  4. #4
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    12

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    Dave,

    Try changing 'required' to 'not required' in the data entry field rule - works for me.

  5. #5
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    379

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    Hi Guys,

    Many thanks for the support. Ran into a flu bug which laid me up for a few days. back again.

    I am using a table 'trde_xact_nom' (9/108) through which I save my 'gen_ledg_xact' (24/294) records. It's a subset. Felt at the time it would be simplier to control ? In hindsight it probably just complicates things. That's probably where my problem lies. Will see what happens if i can save direct. Will keep you posted.
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  6. #6
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    379

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    When I Commit a Form or Browse using 'topparent:Commit()' to save a record, Auto-increment starts at 1, as should be

    When I use the following "procedural-type" coding to save a record, Auto-increment starts at 0, and I use compensating code
    as shown.

    td_gx.enter_begin()
    plug_gx_data(td_gd, td_tx, td_gx, amnt)
    td_gx.enter_end()

    plug_gx_data(td_gd, td_tx, td_gx, amnt)
    '
    ' When we set system to Auto General Ledger Eg. "Sales", Alpha5 does not obey
    ' General Ledger 'gen_ledg_xact->GX_IDF' Auto-increment Data Entry Field Rule
    ' default value settings, to start at value 1, but starts at Value 0.
    ' Hence, the coding that follows.
    '
    ' However, when we set system to manual General Ledger transactions enter
    ' by Operator, Alpha5 does obey the Data Entry Field Rule default value settings,
    ' to start at value 1. (Seems to favour Browse data entry operation)
    '
    ' (A bit surprised that Alpha5 permits this coding to mess with an Auto-increment field.
    ' I expected it to say nix-nix. Fortunately it allows)
    '
    if td_gx.Gx_idf = 0 then 'think it's already auto-incremented ?
    td_gx.Gx_idf = 1 'i'm fooling ya ? Auto-increment !
    end if

    Thanks for your help, Guys,
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  7. #7
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    379

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    Hi Guys,

    I discovered the following in Alpha Help.

    "Post operations performed with field rules only occur when data is input through an Alpha Five form or browse, not through an Xbasic operation or Web Application."

    The same applies to Auto-increment fields.

    Guess that's what I was trying to say in previous reply.

    Once again, thanks for your help.
    Dave Mac

    It's not so much what you don't know that gets you into trouble, but what you know for sure, that just ain't so. - Mark Twain.

  8. #8
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,207

    Default Re: gen_ledg_xact Auto-increment field not starting from Simple default expression

    Sometimes when adding a new table, it helps to create the initial record then add the auto increment rule, which I think may be related to the fact that the index has no records until one actually exists.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Auto Increment - Starting Value based on a Field in Another Table
    By draymen in forum Alpha Five Version 10 - Desktop Applications
    Replies: 9
    Last Post: 08-26-2011, 04:35 AM
  2. Calculated Field Expression that includes auto increment ID field...
    By dickerman7239 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 07-04-2011, 06:12 PM
  3. Simple default expression does not recalc
    By CarverRon in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 01-19-2011, 07:44 PM
  4. Simple Default Expression help needed
    By Charlain in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-13-2003, 08:21 AM
  5. default value with auto increment
    By John Lemisch in forum Alpha Five Version 4
    Replies: 8
    Last Post: 03-16-2001, 09:57 AM

Posting Permissions

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