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

Extremely simple toolbar button code not working

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

    Extremely simple toolbar button code not working

    I have created a toolbar with a single button with a button action of “Run XBasic”.

    The XBasic behind the button is as follows:

    Code:
    msgbox(“Hello world”)
    topparent.fetch_next()
    I then executed the toolbar.

    I opened a form, and used the standard A5V9 toolbar buttons and could easily move to the next record.

    But when I attempted to use my button to similarly move to the next record, the following error message was received after the “Hello world” message box was successfully displayed:

    Code:
    Script: TEMPLATE line:2
    Topparent.fetch_next()
    Argument is incorrect data type.
    Given that I was in the context of a form, i'm puzzled that I received the error message.

    If I enter the name of a specific form, for example, frmPerson.fetch_next(), the next record appears. But I don't want to include the name of the form in the XBasic code.

    Any suggestions for the correct generic XBasic code to accomplish this?

    Bob McGaffic
    Pittsburgh

    PS: I know that there is a Button Action: Internal Action and an Internal Action: RECORD_NEXT. But I would like to be able to move to the next record using XBasic, rather than an Internal Action.
    Last edited by rmcgaffic; 07-09-2008, 07:45 AM.

    #2
    Re: Extremely simple toolbar button code not working

    parentform.fetch_next()

    Comment


      #3
      Re: Extremely simple toolbar button code not working

      G,

      Thanks for the suggestion. Unfortuantely, it's results in the same error.

      Button action: Run XBasic
      Code:
      Code:
      parentform.fetch_next()
      With just this single line of code, the error message received is:
      Script: Template line:1
      Argument is incorrect data type

      Yet this code
      Code:
      frmPerson.fetch_next()
      works perfectly fine.

      I am puzzled that with only one form open, why A5V9 is chocking.

      You would think that either using parentform or topparent, it should have no problems.

      Bob McGaffic
      Pittsburgh

      Comment


        #4
        Re: Extremely simple toolbar button code not working

        Sorry Robert..it might be a v9 issue. I am on v8.
        Don't know what else to tell you other than refresh the control panel, close and re-open alpha although I doubt that any of these will make a difference.
        You could obtain the name of the form dynamically, but that doesn't explain why the above does not work when they should.
        Anything else going on?
        Last edited by G Gabriel; 07-09-2008, 09:46 AM.

        Comment


          #5
          Re: Extremely simple toolbar button code not working

          Bob,
          Have you tried placing focus on the form prior to fetching the record?? Could do it simply by activating any field. I think Alpha is just confused as to where it is, seeing as how you are using a toolbar for the script. Just the first thing I would try when a situation like this arises. May bring up the same error...but maybe not.
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: Extremely simple toolbar button code not working

            Try it without the message box and see what happens.

            Disregard the above. I see that you already tried that.
            Last edited by G Gabriel; 07-09-2008, 10:23 AM.

            Comment


              #7
              Re: Extremely simple toolbar button code not working

              Code:
              obname = a5.Activating()
              ptr = obj(obname)
              ptr.fetch_next()
              Or set the toolbar in the form properties
              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


                #8
                Re: Extremely simple toolbar button code not working

                Tim,

                You're the man!!!

                I am very happy to report that your code allows a toolbar button to advance from one record to another record on any form.

                I extremely happy to report that I was able to add/modify the code snippet suggested by G Gabriel from my posting on set child records not displaying, combine that with your code, and miracle of miracles have a solution!!!

                G's suggestion was to add XBasic code for each child field to force the refresh. This would work, but would be time consuming to code.

                I have been able to refresh all child records (Telephone and e Address) when I move from one record to the next record. And you may be surprised that when I first open the form the child Address, Telephone, and eAddress fields are all populated.

                Several forum readers suggested manipulating the browse control to achieve this, but remember I have a highly customized the browse's properties, and recofiguring those on an exception basis would take forever. As many on this forum have noted, A5 does not include the browse on its style sheet.

                Hopefully over the weekend I'll have an opportunity to write up and document this full solution. I plan to include portions of a white paper I wrote about seven years ago on the display of one-to-many relationships on forms for a CRM software house that had a functional, but I can't believe its this ugly, product.

                While this approach is not currently the "design" of A5V9, perhaps if others see the usefulness and simplicity of this approach, A5 might consider improving its design.

                Bob McGaffic
                Pittsburgh

                Comment


                  #9
                  Re: Extremely simple toolbar button code not working

                  Originally posted by G Gabriel View Post
                  You could obtain the name of the form dynamically, but that doesn't explain why the above does not work when they should.
                  Anything else going on?
                  Robert:
                  As I mentioned, you could obtain the form's name dynamically, but I sure like heck would like to know why the others: topparent & parentform didn't work. They work for me in v8.
                  Is it a v9 issue? a batch issue?
                  I think you should explore this a bit more and not just drop it simply because an alternative script works.
                  Topparent and parentform are bread and butter.

                  By the way, in reference to your other thread, instead of repeated coding, as I suggested ( a video was also attached) you could place and hide a browse. The browse does not have to be anything elaborate, it could have just one field and could be as small as an ant.

                  What you are attempting to describe: "Repeating Records" is a wishlist item that has been a wish of mine for a long time. It is available in alpha in the web application, but not the desktop but it is also something you could code on your own if you are so inclined. I did.
                  Last edited by G Gabriel; 07-09-2008, 12:01 PM.

                  Comment


                    #10
                    Re: Extremely simple toolbar button code not working

                    G,

                    Unfortunately, I uninstalled A5V8 on my laptop, and have only A5V9. I agree with you, why would such simple code not work? But it doesn't. If I have time this weekend, I will try to reinstall it and try again.

                    My ultimate objective is to create software that is easily and rapidly customized by the user. If you read my earlier postings concerning tree menu controls, you may appreciate how easy it would be for a user to create a custom menu, reorganizing an application's forms and reports anyway he chose, without any programming, only a maintenance of a simple table, with a polished appearance not currently possible in native A5V9.

                    Hardcoding is something that I want to avoid like the devil. To me, data-driven design means information is stored in tables which are easily maintained. A lot of A5 development that I have seen thus far appears hard coded.

                    I have no problem putting some XBasic behind a toolbar button, but I am extremely reluctant to put behind a form. I simply can not expect a user, even a somewhat technically sophisticated one, to handle such details. But most are capable of dragging text fields onto a blank form.

                    Bob McGaffic
                    Pittsburgh

                    Comment


                      #11
                      Re: Extremely simple toolbar button code not working

                      Bob, I am glad you got it working.
                      It was a matter of context. Since you opened the toolbar first and then the form separately the form did not know to use that toolbar.

                      You are aware aren't you that you can specify a toolbar in the form's properties. If you call the toolbar in that way the context of the toolbar is within the form's context and then don't need my code snippet.
                      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


                        #12
                        Re: Extremely simple toolbar button code not working

                        I have a feeling I just landed in Oz!
                        Why would anyone open a toolbar before the form?
                        Let's say to use it as a menu.
                        Ok, fair enough.
                        But the script that opens the form, whether from the toolbar or anywhere else, could very well be followed by topparent negating the need for any alternative script.
                        What am I missing?

                        Comment

                        Working...
                        X