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

Errors using buttons on a form

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

    Errors using buttons on a form

    I've got this little app that has about 4 small custom forms for adding/editing customers, inventory, services, & vendors. There are buttons to navigate to save, delete (password req'ed),first, last, next, previous, change to table view and to return to the main menu. All work great with no errors - none whatsoever when the user gets there from the main menu and there are no parent forms open (or any other kind of forms since users are limited by the configuration of the menus & the runtime).

    But, I've allowed users to add or edit child records when they're in the main transaction form so that they can add inventory, customers, prices, etc. on the fly. When they make that choice to change a child record and attempt to use, for instance, the save button after either adding a new customer or changing the contact person or address for an existing one, the buttons always return an error. Fortunately, the errors are only local and don't crash the app so it's not a big problem - mainly an unsightly/unprofessional one for me. They can save with F9 or add a new record with Crtl+E but the buttons are a bomb.

    Any ideas? Thanks for the help with this.

    #2
    RE: Errors using buttons on a form

    what are the error messages?

    do you have xbasic at cansave, onsave, onfetch, etc for the form and/or in field rules for the files?

    Sometimes the code/rules of one thing cause conflict with another, and you just have to keep messing with it until you figure it out.
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: Errors using buttons on a form

      Bill,

      If this is still a problem, you could post a working model here, with instructions on how to throw the error. -- tom

      Comment


        #4
        RE: Errors using buttons on a form

        Thanks for your replies.

        I think the error is the same whatever button is pressed but I just checked the "Save This Record" button in the inventory database and got this:
        Trapped error in Action Command: [1]
        Command: New Record
        Error: Argument is Incorrect Data Type

        Looking at the "Actions..." for this button, I see:
        Action Script ->NewRecord
        Script = OnPush
        Object = Parent

        All of these buttons were created using the button genie and I made no changes to any of the properties other than naming the button. For instance, on the "Save This Record" button I dragged the Button Obj off of the toolbar to the form in design mode, sized it, chose the Built in action (perf. single task) radio but., then Record Operations > Save Record, changed the button text from "Save Record" to "Save This Record" & clicked Finish.

        Comment


          #5
          RE: Errors using buttons on a form

          Bill,

          Since you say that F9 key works fine, why not use

          sys_send_keys("{F9}")

          as the only xbasic on the button? I do this on a number of forms where I trap the F9 key using an OnKey event to run some actions. Saves duplicating scripts. Frankly, I rarely use action scripting, except to see the default xbasic script result.

          Jerry

          Comment


            #6
            RE: Errors using buttons on a form

            Jerry,

            Thanks for the tip - it works as advertised! I then tried re-using your syntax and changing it for "Next," "Previous," "Delete This Record" & "New Record" but substituting "PageUp," "Ctrl+E," etc. for the {F9} in your code doesn't seem to work [ e.g., sys_send_keys("{Ctrl+E}") ].

            Incidentally, where did you find the sys-send-keys command? I looked in the indexes & TOC's on both the manual and Dr. Wayne's Xbasic books and in the program's electronic Help and couldn't find anything about sys_send_keys and how to use it.

            If you know either the syntax for these other keys or where to find the documentation, I'd appreciate it.

            Thanks for the help!

            Comment


              #7
              RE: Errors using buttons on a form

              Jerry,

              Ignore my request - I finally found info on sys_send_key in the electronic help buried DEEP! But it's not indexed in Help, hmmmmm!

              Again, thanks for the help

              Comment


                #8
                RE: Errors using buttons on a form

                Well some work & some don't??
                These work:
                sys_send_keys("{F9}")
                sys_send_keys("{PGUP}")
                sys_send_keys("{PGDN}")

                These don't:
                sys_send_keys("{^D}") neither does "CRTL-D"
                sys_send_keys("{^E}") nor "CTRL-E"

                Nothing happens when I press the button with the above code for deleting a record; when I press the button for creating a new record the form continues to display the current record and a small dialog Alpha Five window opens with an OK button and a ! in a yellow triangle with an asso. "bonk" sound. I click the OK button & nothing happens other than the dialog disappears.

                Any ideas? TIA

                Comment


                  #9
                  RE: Errors using buttons on a form

                  This is more complicated that I thought. Here's what "was" and "is" and "when."

                  When I open the form from the main menu here's what works using the sys_send_key command:
                  Save Record
                  Previous
                  Next

                  The Add Record button didn't work using sys_send so I reverted it back to Action Script -> New Record -> OnPush (I changed the Object from Parent to "Papers" which is the name of the form in use)

                  "Delete This Record" also didn't work with sys_send so I took it back to Xbasic -> parent.delete_record()

                  But, when I am in another form that uses this table (papers) for a lookup and the user chooses to Change some info (I allow this so they can add items on the fly, or change prices, etc.) they I've got trouble in river city! Here's what works...
                  Save
                  Delete
                  New Record

                  But Next & Previous don't.

                  Is there a way to force Alpha to open the table rather than the form? When the user click the Change button at the top of the lookup they go to this form - they prefer the table but I don't have a clue how to force that.

                  Again, thanks...

                  Comment


                    #10
                    RE: Errors using buttons on a form

                    Dunno,

                    This is cut and paste from a menu button the works fine.

                    sys_send_keys("{^D}")

                    Another button uses

                    sys_send_keys("{^E}")

                    and it works fine also. Do you have any code on the OnKey event for the form? Also be sure the the form properties don't restrict delete or adding a new record. If any of the Enter, Change, or Delete boxes are checked, the send_keys won't work.

                    The dialog message box is interesting. The fact that you get it indicates that something is happening on the OnKey event, or an there is some leftover code somewhere. Be sure to compact the database after making many form design changes. Sometimes the old leftover "removed" code causes problems. Compacting will remove the old code, just like packing a table removes deleted records.

                    Jerry

                    Comment


                      #11
                      RE: Errors using buttons on a form

                      Hello Bill,

                      Just my two cents worth here. I'm always for what works, but sys_send_keys() is a 'throw back' to the DOS keystroke days. It basically throws keystrokes at Alpha as if a user had typed them in. It is not totally reliable in my experience. I think it has to do with the user interface and what Alpha is up to at the time. Ira says that if the control panel is maximized sys_send_keys() is unreliable. I've found that even with the control panel minimized and active, I've still had problems with sys_send_keys(). IMHO sys_send_keys() should only be used when there isn't any other choice, and these times are few and far between with v4.5. The only situations I can think of are loading a different adb or automating a network optimize. Without seeing your code and the context it is running in I couldn't tell you what your problem is, but it should be fairly easy to find out. Go into form design mode and go to the actions for an offending button. I'm assuming you'll be at the action scripting editor. Convert the action script to xbasic(code menu choice and then 'convert to xbasic'). Now you'll be in the xbasic editor. Put your cursor at the very beginning of the first line and press the enter key to get a blank line at the beginning of the script. Now on this blank line put the following code:
                      debug(1)
                      Save and then open up the form and press the offending button. The debugger will come up and you can run the script line by line. When you get an error message, see which line of the script is causing the problem and post it here. My guess is you have a context problem. Alpha is probably referencing an object that doesn't exist, or cannot be evaluated by the given syntax in the current context.

                      Good luck,
                      Jim

                      Comment

                      Working...
                      X