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

Default start value not resetting

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

    #16
    Re: Default start value not resetting

    OK, I am really struggling with this trying to develop a workaround. As I said, I can't really put a dummy record as the first record because the quote is used to develop all sorts of other forms. So I need to look for a programmatic workaround. First question is how do I know I am dealing with the first quote? The start default number will be different system-by-system since the user has the option to set the start quote number anywhere he wants. I guess I could read the default from the field rule and see if my quote number was the same?
    Second, assuming that this will allow me to know that this is the first quote, how do I work around the problem? What is it that will allow me to delete the first record while still retaining the default for the new first record? Zapping the table seems to work fine as far as I can see, so possibly if I close the table and then zap it?
    Any comments or other suggestions?

    Comment


      #17
      Re: Default start value not resetting

      I am now looking at trying to solve this problem in the "create new quote" logic. I am carrying the required start quote number setup by the admin during system setup as a global variable. The idea is that in the "new quote" form I will check on exit to see if the quote number is less than the global variable, and if it is I will set the quote number equal to the global variable. Hopefully that will solve the problem, and I can avoid the bug.

      Comment


        #18
        Re: Default start value not resetting

        Nick:

        I have found a rather simple method of avoiding the bug. The bug appears when the initial starting default value of the table is deleted mistakenly while attempting to delete the initial record of the table. This Default value is able to be deleted because it is displayed and highlighted on the form after deleting the initial record.

        To correct the problem:
        1. Be sure your table is zapped and verify that it is working properly.
        2. Go to the table field rule editor and go to the data entry tab of your auto increment field. Scroll down to the bottom where it says "Position cursor at:" now select from the drop down box "End of selected text".
        3. Save your changes and try it.

        Now after deleting the first record the default value will not be highlighted so mistakenly pressing the delete button again won't allow deletion of the default number. I've zipped up a sample for you to play with but it works for me every time. I do admit it is not full proof since someone could after deleting the initial record, highlight the default value using the mouse, press delete again to remove the value. Although this is possible it's not likely to occur since it is only possible on the initial record.

        Comment


          #19
          Re: Default start value not resetting

          On the Data Entry tab in field rules set the Skip expression to .t. That way a user can never enter that field.
          Tim Kiebert
          Eagle Creek Citrus
          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

          Comment


            #20
            Re: Default start value not resetting

            Neither of these have any effect. My cursor setting was already as suggested. "delete" is only happening once because it is xbasic on a button. Also the quote number field on the form is read-only.

            Comment


              #21
              Re: Default start value not resetting

              Originally posted by Nick Oldfield View Post

              The form where I create the quote has an embedded browse (for quote items - child records) so when I exit to cancel the quote I can't be certain whether the quote has already been saved (if focus has moved to the child the parent will have been saved). When I push the button for "Cancel and Exit" the following occurs;
              'write the record in case it hasn't been
              parentform.commit()
              'delete the current record in parent
              (this is the AlphaScript code for that action)
              'close the form
              parentform.close()

              As I said, this mechanism works fine except if I cancel the very first quote I am in the middle of entering.

              Any ideas?
              Nick:

              I altered my original autonum test data base to a parent Child set as you describe above with an embedded browse on the form. Open the form and test it, I haven't been able to make it fail. The buttons on this one all use the action scripting only. I have successfully canceled out of the first form, added several forms and deleted them all, canceled 1/2 way through, canceled after adding multiple child records to the first form etc.. Each time the autonumber field properly numbers.

              If you feel this sample is not similar enough to yours could you post a sample?

              Paul

              Comment


                #22
                Re: Default start value not resetting

                your sample got me thinking and doing some more analysis and the problem is SOLVED - well, it's still a bug, or a documentation issue, or both.
                I noticed with my code if I went to enter a new quote 1000 and did not enter any data at all, the quote number successfully reset to 1000. If I entered any data, either in the child or parent, the quote number briefly changed to 0000 as the form was closed. Almost as if the form were being refreshed after it was closed. This does not happen in your example. So I started to compare your example with my code. First, just to be sure, I changed the name ID field to character, since that was the same as mine. That had no effect. Then I started to look at the field rules. I noticed that in the field rule where you set the default, you had checked "set default value at start of data entry". I had not checked that box - according to the documentation that should only be checked if you want the same default value to appear in every new record, which I don't. And without it checked, the default value appears correctly when you enter the first record, so I had assumed things were OK. BUT if you DO check the box, that solves the 0000 quote number problem when you cancel the first record, and does not screw up any of the subsequent records! Despite having checked the box that supposedly sets the default to be the same on every record, it does not happen that way. There is obviously something in the interaction between the default and increment field rules that isn't clear.

                So the problem could at least be be avoided by changing the text on the field rule. On the "tip" for the autoincrement field rule, should be added "and make sure the 'set default value at start of data entry' box is checked"

                Thanks for the help!!

                If I have any more problems with this I will post back.

                Comment


                  #23
                  Re: Default start value not resetting

                  Originally posted by Nick Oldfield View Post
                  you had checked "set default value at start of data entry". I had not checked that box - according to the documentation that should only be checked if you want the same default value to appear in every new record, which I don't. And without it checked, the default value appears correctly when you enter the first record, so I had assumed things were OK. BUT if you DO check the box, that solves the 0000 quote number problem when you cancel the first record, and does not screw up any of the subsequent records! Despite having checked the box that supposedly sets the default to be the same on every record, it does not happen that way. There is obviously something in the interaction between the default and increment field rules that isn't clear..
                  Nick:
                  I'm glad you have the problem corrected. I will agree there is a bug in the autonum for sure. You are a little off on the "Set default value at start of data entry" check box though. I read the help file on this and I see what your saying, it's just documented in a confusing way. Without that box checked the default value will be set on that field on receiving the focus. With the box checked the default number will be set on the start of data entry - Won't use the same number it just determines when it is entered into the field - autonumber still applies and all records should have a different number with or without the check box selected.

                  I agree this also does not respond quite how it should but it certainly does help us avoid the autonum problem.

                  Let us know how you make out


                  Tim:

                  I had tried skipping the field with .t. but for some reason it doesn't resolve the problem and I'm not sure why - believe it is part of the bug as well. Even with the above work around adding the .t. in the skip box forces the autonum to fail - the autonum seems a little buggy regarding removal of the first record - I hope Alpha takes a look.

                  Comment

                  Working...
                  X