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

Run command after pressing submit

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

    Run command after pressing submit

    I have created a dialog component with a few fields which feeds a table built to track inspections. I also have a child table used to track the inspection findings. I need to be able to open a page containing the child table once I submit the main parent dialog component.

    I have tried using a link field and it does work as long as I press the submit button prior to pressing the link. If I press submit (without a redirect) and than the link, everything works fine. My parent table is assigned an ID and that ID is feed to the child once the link is pressed.

    However, when I include the link url in a redirect statement in the aftervalidate event, my parent table recieves the correct ID data but my child table is assigned a value consisting of the child tables name.

    Is there any way to have a statement placed in the aftervalidate that will trigger the link control?

    Thanks.

    #2
    Re: Run command after pressing submit

    I think it would help explain your situation if you posted the code from your AfterValidate event.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Run command after pressing submit

      Hello
      This is what I have in the bottom of my dialog's AfterValidate that brings me to a grid in another table once I press my dialog's submit button.

      CurrentForm.RedirectTarget = "Em_Reg.a5w?Userid=CurrentForm.controls.userid.value"
      Eric

      Alpha Five Websites
      longlivepuppies.com
      socialservicenetwork.com
      -------------------------------------------------
      socialservicenetwork.org

      Comment


        #4
        Re: Run command after pressing submit

        Eric,

        Do you mean:

        CurrentForm.RedirectTarget = "Em_Reg.a5w?Userid=" + CurrentForm.controls.userid.value
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: Run command after pressing submit

          Hmmm, you are probably correct Steve. The method I suggested does also work (for me) but you are probably correct.
          Eric

          Alpha Five Websites
          longlivepuppies.com
          socialservicenetwork.com
          -------------------------------------------------
          socialservicenetwork.org

          Comment


            #6
            Re: Run command after pressing submit

            Thanks for the help guys but it that hasn't solved it.

            Here goes:

            My safetyround (Dialog) component has 4 fields:

            Tour_id (Textbox - 20 Character)
            Dept_id (Dropdownbox)
            Tour_type (Dropdownbox)
            Tour_date (Textbox - Date)

            I have an initialize event of:

            CurrentForm.Controls.Tour_id.value = ctime(now() )

            I am using this value as my *unique* id for the Tour_id

            I have an aftervalidate event of:

            t = table.open("[pathalias.adb_path]\safetyrounds")
            t.enter_begin()
            t.Tour_id=(CurrentForm.Controls.Tour_id.value)
            t.Dept_id=alltrim(CurrentForm.Controls.Dept_id.value)
            t.Tour_type=alltrim(CurrentForm.Controls.Tour_type.value)
            t.Tour_date=convert_type(CurrentForm.Controls.Tour_date.value, "d")
            t.enter_end()
            t.close()

            CurrentForm.RedirectTarget = "newsafetyrounddetails.a5w?Tour_id=" + CurrentForm.Controls.Tour_id.value

            **************

            The newsafetyrounddetails.a5w page contains a component named safetyroundfindings.

            My safetyroundfindings (Grid) component has 3 fields:

            Tourd_id (Textbox - 6 Character)
            Tour_id (Textbox - 20 Character)
            Tourd_finding (Textbox - 150 Character)


            ***************

            So, when I press submit on the parent (safetyround), all information, including my Tour_id value generated with my initalize event is entered in to it's associated table and I am than redirected to my newsafetyrounddetails.a5w page containing the safetyroundfindings component. None of the fields, including Tour_id are populated. When I press submit, the data entered in to the Tourd_finding field is transfered but the Tour_id field is empty.

            One more thing, both components are set to "Add only".

            Thanks in advance for offering your assistance.

            Comment


              #7
              Re: Run command after pressing submit

              When you say "add only" for your grid, do you mean, "add records only?" If yes, then anytime you access this grid you will have empty fields. It is set up to think you want to create another record.

              If your goal is to initially enter data into your dialog then click submit and go to this grid and see the data you just entered (and already saved in your table) then in your grid's properties, un-check add records only. If you wish to add additional information into this grid...in update settings, check "allow insert"
              Last edited by EricN; 12-03-2008, 05:15 PM.
              Eric

              Alpha Five Websites
              longlivepuppies.com
              socialservicenetwork.com
              -------------------------------------------------
              socialservicenetwork.org

              Comment


                #8
                Re: Run command after pressing submit

                My goal is to first create a new safety round event using the first component(safetyround). I than would like to be redirected to the safetyrounddetails component where I can add the details for the safety round event I just created. The two are linked via the Tour_id field.

                Comment


                  #9
                  Re: Run command after pressing submit

                  Ok. It looks like I'm correctly understanding what you hope to accomplish and what I just described above (#7) should help.

                  This is very similar to what I do in my app.
                  Eric

                  Alpha Five Websites
                  longlivepuppies.com
                  socialservicenetwork.com
                  -------------------------------------------------
                  socialservicenetwork.org

                  Comment


                    #10
                    Re: Run command after pressing submit

                    Thanks for your help Eric but I don't want to waste your time with my problem.

                    I have tried what you have suggested but is still does not work.

                    You see, when I press submit on the first component (safetyround), it only adds a record in the parent table (safetyround), including the Tour_id number generated in my initialize event. No records, associated with this new event, have been added yet in the child table (safetyroundfindings). Therefore, there is nothing yet linking the two tables.

                    What I am trying to do is to add a new record in to the child table (safetyroundfindings) and have the Tour_id value (generated by my initailize event and recorded in the parent table) autotomatically entered in to the Tour_id field on the child table (safetyroundfindings) thereby creating my parent to child link.

                    As I said above, I really do appreciate the help but please don't feel obligated to conitue to spend time on this issue.

                    Thanks again.

                    Comment


                      #11
                      Re: Run command after pressing submit

                      You can never pre-populate a "blank" record in a GRID. Your safetyroundfindings needs to be a Dialog unless you actually create the safetyroundfindings record in the previous process and then open that record in a grid via a filter.

                      Once you switch to a dialog, Eric's good advice about Add Only will no longer apply. Add this to your safetyroundfindings Activate Event:

                      CurrentForm.Controls.Tour_id.value = Tour_id

                      Tour_id will be a Page Variable and available to the dialog.

                      Also, keep your component names less than 15 characters else you may get some conflicts down the road.

                      And don't worry about how much effort others put in to your problems. That is the way everyone learns how to best use the product. Eric's rise as a developer is a perfect example.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: Run command after pressing submit

                        Hi Steve,

                        Fortunately, I learn from my mistakes, and after four or five hours of trying to pre-populate a grid I finally figured out that it doesn't work. It is safe to say that I will never try to do that again. I do prefer to use dialog components anyhow where possible.

                        The component now works like a charm...Yes!...AND, I learned a lot in the process. I will take your words to heart regarding others efforts and I promise to pay back some other newbie down the road.

                        I do have an extensive background in MS Access and I use to have a good handle on VB. It is starting to come back to me a bit.

                        BTW, I have now modified all of my tables, fields and component names to be 15 characters or under. Thanks.

                        Rob

                        Comment

                        Working...
                        X