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

Web Dialog Database not talking

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

    Web Dialog Database not talking

    Hi I am creating my first web Dialog. I linked it to a table
    using some x basic code. The connection works but when
    I put numbers in my form the rows in the table just show up
    with 0.00 the table look for numeric only and all the columns
    are being filled with 0.00 after I press the submit button, insted
    of the numbers I put in the form.

    #2
    Re: Web Dialog Database not talking

    Welcome to Alpha web...

    You might have to post the xbasic here for it to make sense. Everything on a web dialog is Charactor, even if you select Numeric, etc. To save to your numeric table field, you would need to use something like this:

    tbl.mynumber = convert_type(mydialogfield,"N")

    But posting the xbasic will help, because maybe it isn't even posting results.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Web Dialog Database not talking

      Thanks Steve. It worked.

      Comment


        #4
        Re: Web Dialog Database not talking

        Hi Steve, I'm a newbie having trouble posting back to my table after pressing submit on a web dialog. I'm able to load the data into the dialog just fine using this code in INITIALIZE:

        dim t as P
        dim rec as N
        if eval_valid("PageVariables.Id") then
        t = table.open("[PathAlias.ADB_Path]\pekids_table")
        t.order("Id")
        rec = t.fetch_find(val(PageVariables.Id))
        if (rec > 0) then
        ParentLast = alltrim(t.PARENT_LASTNAME)
        ParentFirst = alltrim(t.PARENT_FIRSTNAME)
        HomeNum = alltrim(str(t.HOME_PHONE))
        WorkNum = alltrim(str(t.WORK_PHONE))
        CellNum = alltrim(str(t.CELL_PHONE))
        Street = alltrim(t.STREET_ADDRESS)
        City = alltrim(t.CITY)
        end if
        t.close()
        end if


        then in the AFTERVALIDATE event I have this:

        dim t as P
        dim rec as N
        if eval_valid("PageVariables.Id") then
        t = table.open("[PathAlias.ADB_Path]\pekids_table")
        t.order("Id")
        rec = t.fetch_find(val(PageVariables.Id))
        if (rec > 0) then
        t.PARENT_LASTNAME = alltrim(ParentLast)
        t.PARENT_FIRSTNAME = alltrim(ParentFirst)
        t.HOME_PHONE = convert_type(remspecial(HomeNum),"N")
        t.WORK_PHONE = convert_type(remspecial(WorkNum),"N")
        t.CELL_PHONE = convert_type(remspecial(CellNum),"N")
        t.STREET_ADDRESS = alltrim(Street)
        t.CITY = alltrim(City)
        end if
        t.close()
        end if


        It does the validation properly (I'm using the javascript boxes) and doesn't complain when I press submit, but the changes are not reflected in the database.

        What am I doing wrong here?

        Comment


          #5
          Re: Web Dialog Database not talking

          You need to use t.change_begin() to put the table into change mode for your record, and then t.change_end() to commit the change.

          Lenny Forziati
          Vice President, Internet Products and Technical Services
          Alpha Software Corporation

          Comment


            #6
            Re: Web Dialog Database not talking

            Thanks for the fast response!
            I assumed you meant like this:

            t = table.open("[PathAlias.ADB_Path]\pekids_table")
            t.order("Id")
            rec = t.fetch_find(val(PageVariables.Id))
            if (rec > 0) then
            t.change_begin()
            t.PARENT_LASTNAME = alltrim(ParentLast)
            t.PARENT_FIRSTNAME = alltrim(ParentFirst)
            t.HOME_PHONE = convert_type(remspecial(HomeNum),"N")
            t.WORK_PHONE = convert_type(remspecial(WorkNum),"N")
            t.CELL_PHONE = convert_type(remspecial(CellNum),"N")
            t.STREET_ADDRESS = alltrim(Street)
            t.CITY = alltrim(City)
            t.change_end()
            end if
            t.close()

            but the changes still didn't post.

            Comment


              #7
              Re: Web Dialog Database not talking

              Have you verified that rec is not zero?

              Lenny Forziati
              Vice President, Internet Products and Technical Services
              Alpha Software Corporation

              Comment


                #8
                Re: Web Dialog Database not talking

                Shoot, I feel a little silly about not checking that. Since the INITIALIZE event successfully used the same method to get the data already stored in the current record, I assumed it worked here. Maybe my pagevariable is no longer in scope or something. BTW, I did use (.T.) with the change_end function.

                In terms of debugging, what's the easiest way to throw up a value somewhere where I can see it? If I were programming some other language, I'd do something like

                if (rec > 0) then msg_box("rec retrieved ok").

                Is there something like ui_msg_box() for web apps?
                Last edited by drowelf; 09-21-2007, 07:03 PM. Reason: clarification

                Comment


                  #9
                  Re: Web Dialog Database not talking

                  OK, I created some debugging code and just wrote the text to one of the textboxes on my dialog. Turns out that

                  if eval_valid("PageVariables.Id") then

                  is evaluating to False, even though it evaluated to True in the INITIALIZE event. I can get around this by actually storing the ID on the dialog and then using this info later instead of the pagevariable. However, an internal variable would be better. Is there a way for me to keep this PageVariable around, or to create my own variable that will stick around so that the AFTERVALIDATE even can use it?

                  Comment


                    #10
                    Re: Web Dialog Database not talking

                    Originally posted by drowelf View Post
                    Is there a way for me to keep this PageVariable around, or to create my own variable that will stick around so that the AFTERVALIDATE even can use it?
                    I think you want a session variable. Something like:

                    session.id
                    Peter
                    AlphaBase Solutions, LLC

                    [email protected]
                    https://www.alphabasesolutions.com


                    Comment


                      #11
                      Re: Web Dialog Database not talking

                      I've never understood exactly why local variables don't stick between events. For instance, if you set name=steve in the Validate, its not available in the AfterValidate event. It must be due to the fact that this is all operating in a web environment and whenever you press Submit, you are refreshing the page. If I need a variable to exist between events, or after, I always use session.variable=myvalue, in whatever event the value myvalue exists.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: Web Dialog Database not talking

                        I took your advice and used a session variable to store my ID number. It sticks around from the Initialize Event to the AfterValidate Event as expected. However, here:

                        http://msgboard.alphasoftware.com/al...ad.php?t=69352

                        I describe trying to update anoter session variable inside a control's OnClick Event. For some reason, this update is never happening. Any idea why the OnClick Event wouldn't see a session variable?

                        Comment


                          #13
                          Re: Web Dialog Database not talking

                          I know from testing that code there does not do anything if the control is a text field of any type. You can test easily by putting rsponse.redirect("bogus") in the OnClick event, then view in browser and click the control.

                          However, it you change the control to an Advanced Button, it fires that code when the button is clicked. So far as I can tell, that OnClick is reserved for the Advanced Button.

                          Change your logic - in the Initailize save all values to temp variables. In the AfterValidate, test for any difference between temps and the new values, save recrod if so. Write your audit trail at the same time.

                          note - I have an article on my website about audit trails in web apps.
                          Steve Wood
                          See my profile on IADN

                          Comment


                            #14
                            Re: Web Dialog Database not talking

                            Aha. In most places, when you change the control type, the valid options appear/disappear as appropriate. Since the OnClick was still there, I assumed the obvious. I think I'll try your audit solution and also check your website.
                            Thanks, for your quick reply!
                            tls

                            Comment


                              #15
                              Re: Web Dialog Database not talking

                              Whoa, that audit article is great! I'm writing this just in case later readers didn't notice that quick suggestion. If you're reading this thread because you have a similar goal as mine, you should definitely check out this article. I'm not sure if it's ok to link directly, so just go to Alphatogo.com --> ForDevelopers --> search for "Audit". It's a PDF file with an easy to understand guide.

                              Comment

                              Working...
                              X