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

Submitting Dialog Builder to a table

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

  • Submitting Dialog Builder to a table

    I have built a Dialog Builder component with a submit button.
    I am hoping to be able to submit the contents to a table "registration.dbf" but cannot see how this is done.
    The ID is RegID

    I have this in the After Validate FormEvent
    t = table.open("registration.dbf")
    t.enter_begin()
    t.Regid = alltrim(currentform.controls.name.value)
    t.enter_end(.t.)
    t.close()
    In a live preview I get the error

    Errors in: event.AfterValidate code:
    Property not found
    currentform.controls.name subelement not found.
    Can anyone say how I can do this please?
    Thanks
    john

  • #2
    Re: Submitting Dialog Builder to a table

    John,

    This indicates that you have a control in your dialog named "name". Generally, it is not a good idea to use control names that are reserved words or words that are commonly used in programming. So, my first suggestion is to change the field name to vName or name1 or fullname or something other than "name". Similarly, if you have a date field, don't name it "date".

    Second, if you are going to be publishing this to a server, you should create a path alias for the table, and then the line would be

    t = table.open("[PathAlias.ADB_Path]\registration.dbf")

    That will help you avoid a future problem.

    Third, I wouldn't use the person's name for the regid. What if you have two people named "John Smith"? Usually, you would create an autoincrement field for the id.

    Other than that, your after validate script looks fine.

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


    • #3
      Re: Submitting Dialog Builder to a table

      First off,
      I have always had to add the declaration

      Dim t AS P
      before
      t = table.open("registration.dbf")
      -
      But if you don't need it great,
      Also generally either a Path or Alias before "registration.dbf"

      Ok
      currentform.controls.name subelement not found.
      means on this form you do not have a control expliciltly with a name ID of "name"
      Is this correct?
      If so use the name of the control,
      -
      Also the code makes the assumption, that t.Regid is a
      simple character type field that can be written to and not lets say an autoincrimented field

      For a simple Test
      Change
      t.Regid = alltrim(currentform.controls.name.value)
      to
      t.Regid = "TEST Return"
      and see the result

      Regards

      Comment


      • #4
        Re: Submitting Dialog Builder to a table

        Thanks amd My apologies for not coming back sooner. I will get back to this soon. Been delayed
        Regards
        John

        Comment


        • #5
          Re: Submitting Dialog Builder to a table

          The code is now:
          Dim t AS P
          t = table.open("registration.dbf")
          t.enter_begin()
          t.Regid = "TEST Return"
          t.enter_end(.t.)
          t.close()
          The error is now:
          Errors in: event.AfterValidate code:
          Data value cannot fit into a numeric field of size
          t.Regid subproperty cannot be assigned to

          Field rules for Regid field is numeric, auto increment

          Comment


          • #6
            Re: Submitting Dialog Builder to a table

            John,
            Regid field is numeric, auto increment
            Nice bit of new info---changes how solutions will be given for sure---

            For instance--by definition an auto-incremented field is not a user entered one and cannot be changed as such.

            Also you now have divulged that the Regid is numeric so the troubleshooting suggested cannot work---setting a numeric field to a character value cannot be done.

            My contention is that you cannot do as you want in your first post--to change an auto-increment to something of your choosing....and begs the question as to why would you ever want/need to??
            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


            • #7
              Re: Submitting Dialog Builder to a table

              Thanks Mike
              I understand what is being said about auto increment.

              I am new to alpha5 and am trying to understand how to submit a record from the dialog builder component.
              I found the original script and tried to understand what it is doing and how to adapt it to my needs. Obviously didnt do too well.

              Perhaps you know of an article somewhere which will help me understand.

              Comment


              • #8
                Re: Submitting Dialog Builder to a table

                John, we will get there !!
                Lets say in the Registration.dbf table,
                You were to make a new 'character' type field 'RegTest'
                And another new Numeric type field 'RegNum'
                then modify to :--

                Dim t AS P
                t = table.open("registration.dbf")
                t.enter_begin()
                t.RegTest = "TEST Return"
                t.RegNum = 89
                t.enter_end(.t.)
                t.close()
                I'm doing this so that you have something that works, rather than the right answer.

                --
                To elaborate on MIkeC's input
                An autoincriment(ed) field maybe either "Character" or "Numeric", In both cases Assigning a Value to the field I have never seen work,
                Also Calculated fields are 'similar' to AutoIncriment in this.
                -
                There is no reason why you should not use two ID fields
                eg The AutoIncriment and your own RegID field
                A good idea is to "never ever" use the Record Number as any form of persistent ID
                Also for search capabilities I have found that Making all ID fields type character will make things easier later.

                The Format, you used
                t.Regid = alltrim(currentform.controls.name.value)
                is good for type 'CHARACTER' fields and controls
                but
                t.Regid = Val(currentform.controls.name)
                for 'NUMERIC' fields and controls

                Comment


                • #9
                  Re: Submitting Dialog Builder to a table

                  Thanks Colin
                  Sorry I am being so thick on this. I did as you suggested and ammended the FormEvents code to
                  Dim t AS P
                  t = table.open("registration.dbf")
                  t.enter_begin()
                  t.RegTest = "TEST Return"
                  t.RegNum = 89
                  t.enter_end(.t.)
                  t.close() and this caused a new record to be added with the two fields
                  RegTest and RegNum showing correctly inthe table.
                  However none of the other field collect the data from the form, so these are left blank in the table
                  I attach the present table.
                  Cheers

                  Comment


                  • #10
                    Re: Submitting Dialog Builder to a table

                    No Problems John,
                    -
                    Ok please be aware that we have two separate 'objects'
                    One being Field Names eg Regfname and Reglname
                    and these will generally map to Controls with quite possibly different names
                    -
                    I'm unsure what you have chosen but it could be FirstName and LastName

                    in this case your code would look something like

                    Code:
                    Dim t AS P
                    t = table.open("registration.dbf")
                    t.enter_begin()
                    t.Regfname = alltrim(currentform.controls.FirstName.value)
                    t.Reglname = alltrim(currentform.controls.LastName.value)
                    t.enter_end(.t.)
                    t.close()
                    so just Correct what Should be FirstName and LastName

                    here,
                    The editor has an autocomplete / Auto Suggest feature and if your code is correct when typing t. or CurrentForm.Controls.
                    will suggest what the Fiel or Controls names are
                    your Date Field will probably be best using the VAL() syntax to get the value.


                    Good luck

                    Comment


                    • #11
                      Re: Submitting Dialog Builder to a table

                      Without getting to involved...

                      CONVERT_TYPE() converts variables from one data type to another, preserving the data if possible.

                      Everything in the dialog is text. You need to tell the dialog how it should be saved.
                      Insanity: doing the same thing over and over again and expecting different results.
                      Albert Einstein, (attributed)
                      US (German-born) physicist (1879 - 1955)

                      Comment


                      • #12
                        Re: Submitting Dialog Builder to a table

                        Very many thanks for all the replies and help in getting the submit button sorted out.
                        I have finally managed to understand some of the answers and the submit button is now working.
                        I did not realise that a submit button in a dialog used xbasic!
                        Regards
                        John

                        Comment

                        Working...
                        X