Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Automatic Id problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automatic Id problem

    I never had this problem in two months that I am testing my application, but now sometime it comes out.

    I have an ID field that is automaticly assigned with a random unique code when you add a new record. But this often is not happening!! This is really important for my application because everything is based on id links...

    Can you tell me why?

    #2
    Re: Automatic Id problem

    Luca, your post is the same thing as saying my application is broken, can you tell me why?

    The answer is either no, not based on the information you've supplied thus far. Or, the answer is yes, the routine you use to assign unique codes is failing.

    Comment


      #3
      Re: Automatic Id problem

      I use field rules. I gave a default value that is assigned when the field is untouched...

      this worked for two months (more considering the building time) of constant work. I didn't change anything in the program.

      Now can you please explain me where can nestle the problem....

      Comment


        #4
        Re: Automatic Id problem

        assigned with a random unique
        what do you mean random unique?
        If it is random, how do you it's unique?

        Comment


          #5
          Re: Automatic Id problem

          Originally posted by lucasushi View Post
          I use field rules. I gave a default value that is assigned when the field is untouched...
          Maybe the reason that the rule is not working now is because the field is being "touched".

          Honestly we are gonna need more details in order to help you resolve this problem. Until we get the details we can only guess at the true reason.
          Andrew

          Comment


            #6
            Re: Automatic Id problem

            Luca, explain the default value calculation you are doing and give us some examples of the resulting field values. Can we see the expression itself? If it relies on other field values in the same record can you supply sample data so we can exercise the expression in context?

            Comment


              #7
              Re: Automatic Id problem

              Originally posted by lucasushi View Post
              I use field rules. I gave a default value that is assigned when the field is untouched...

              this worked for two months (more considering the building time) of constant work. I didn't change anything in the program.

              Now can you please explain me where can nestle the problem....
              Is it possible the field isn't large enough to accomodate new (unique) IDs? We had a similar problem with an Oracle database a few years ago where the field was 8 or 10 digits in the database, but in the application, the developer decided that 6 digits were enough for the article ID number and the sequence/auto-increment suddenly got too long for the application to handle.

              Comment


                #8
                Re: Automatic Id problem

                Maybe the question has to do with the unique random number generated by Windows.

                Comment


                  #9
                  Re: Automatic Id problem

                  Maybe this last can be a solution. Maybe.

                  I don't have here in this pc the program and I can't remember the expression exactly. But I can give more information about the field:

                  This is composed field. An example is RF02/08XX.
                  The field is composed like this:
                  - RF is a static part. Always the same.
                  - 02/08 is the current month and year.
                  - XX is a two random letters part (AA, AB, AC etc...)

                  The field has the only read property. So cannot be touched.
                  The length of the field is always the same.
                  All combination of random letters are enough in a month.

                  I will soon give you more details, but I think is important to note that only sometimes happens and suddenly, after a long period that was correctly working.

                  Do you think can be a bug?

                  Comment


                    #10
                    Re: Automatic Id problem

                    But what is it not doing? Is it not filling in any value, it the value not unique? Is it repeating values (it will)? On that last point, as Gabe pointed out, random numbers are NOT unique. If you have a high number of records in any given month, there is a high chance your forumula will create non-unique values.
                    Steve Wood
                    See my profile on IADN

                    Comment


                      #11
                      Re: Automatic Id problem

                      I specified that
                      All combination of random letters are enough in a month.
                      I don't have so much new records every month.

                      The problem is that when a new record was created simply the ID code is not assigned. Stays blank!

                      It is an only read field, so users cannot solve the problem.

                      Now I added the property "Always required" but is only a problem because user cannot insert an ID and cannot save! but is the only way. I can't risk making a record without ID number.

                      Comment


                        #12
                        Re: Automatic Id problem

                        No one can guess what is wrong, especially if it 'suddenly stopped working'. You're going to have to provide at least what the expression is for the calculated field (the actual calculation copied directly from the field rule, not a description). Probably that won't be enough and someone will have to actually look at the Form, Table and Field Rules together.

                        And, not that this is the point of this discussion, your "random" means that if you get "AA" on your first pass, you might get "AA" on your second pass too. So even if its unlikely in the short term, it is very likely in the long term that you will get duplicate values for your 'unique' field.
                        Steve Wood
                        See my profile on IADN

                        Comment


                          #13
                          Automatic Id Problem (part2)

                          I'm trying to answer at my thread but it seem to be impossible for my account (is asking me to log in continuosly???)

                          Anyway, the default value expression is

                          Code:
                          "RF"+ DATE_FORMAT(DATE() , "yy/MM")+UPPER(RAND_STRING(2))
                          This expression gaves enough combination, because has two random letters for every month...

                          Comment


                            #14
                            Re: Automatic Id Problem (part2)

                            I was right.

                            the answer is yes, the routine you use to assign unique codes is failing.
                            You want unique, it produces random.

                            Have you ever rolled dice? Ever get the same number twice in a row? This happens even though each dice roll is random. Dice do not produce unique results. Neither does the rand_string() function.

                            Comment


                              #15
                              Re: Automatic Id problem

                              The "random unique" issue has been addressed and I hope by now you realize that you have no guarantee, based on your expression, of generating unique values which is much more dangerous than the problem you are having now since if you don't have unique values, you will get the wrong child records and bill someone for a $1000 they did not owe.

                              But that does not explain the problem you were concerned with :
                              The problem is that when a new record was created simply the ID code is not assigned. Stays blank!
                              For that, we need to know all your field rules and if you have any scripts.

                              That said, there is no point of fixing a bad routine. It will only serve as an academic exercise. You need to use autoincrement in place of random strings and start over.

                              Comment

                              Working...
                              X