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

initializing field

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

    #16
    Re: initializing field

    run the script on debug and see if all the fields are populated and then look for the error text either in debug or assign it then check.
    it should work as is.
    I am not on version12, I doubt they changed anything on this one between versions.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    [email protected]
    Skype:[email protected]
    1 914 924 5171

    Comment


      #17
      Re: initializing field

      Originally posted by GGandhi View Post
      run the script on debug and see if all the fields are populated and then look for the error text either in debug or assign it then check.
      it should work as is.
      I am not on version12, I doubt they changed anything on this one between versions.
      Also can the record be updated using detail view? what is the function of "debug(1)" is it not for debugging to show?
      Last edited by eduduru; 07-13-2015, 10:37 AM.

      Comment


        #18
        Re: initializing field

        on debug look on the top there is step something like that it will step thru.
        make sure your field names are correct. most often the spelling errors are the one that cause problems.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #19
          Re: initializing field

          I updated the secondary table from the detail view new record button. no special method.
          thanks for reading

          gandhi

          version 11 3381 - 4096
          mysql backend
          http://www.alphawebprogramming.blogspot.com
          [email protected]
          Skype:[email protected]
          1 914 924 5171

          Comment


            #20
            Re: initializing field

            Originally posted by GGandhi View Post
            on debug look on the top there is step something like that it will step thru.
            make sure your field names are correct. most often the spelling errors are the one that cause problems.
            It is not yet inserting, i have checked all from here, i dont know why?

            Comment


              #21
              Re: initializing field

              Originally posted by eduduru View Post
              It is not yet inserting, i have checked all from here, i dont know why?
              Hi GGandhi!

              can i insert into multiple tables using this method?

              Comment


                #22
                Re: initializing field

                yes
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #23
                  Re: initializing field

                  Hey Chinedu,

                  There are a couple of issues with your code.

                  1. You're dimming ResidentialStateId as a number but the data coming in from the grid is actually text - that's how it gets passed back. To ensure you're assigning what you want, convert where needed.
                  2. You have an error in the code that returns your javascript alert. You must include single quotes in order to properly quote your text.

                  I've changed the code a bit to make it a bit more readable. Also, use args.set instead of args.add. The .set "re-sets" or "adds".

                  The following code works in the AfterInsertRecord event...

                  Code:
                  dim cn as sql::Connection
                  dim result as l
                  dim args as sql::Arguments
                  dim sqlInsert as c
                  dim message as c
                  
                  dim ApplicantId as n = e.lastIdentityValue
                  dim ResidentialAddress as c = e.DataSubmitted.ResidentialAddress
                  dim City as c = e.DataSubmitted.City
                  dim ResidentialStateId as n = val(e.DataSubmitted.ResidentialStateId)
                  
                  result = cn.open("::name::Test")
                  if result then
                  	sqlInsert = "INSERT INTO ApplicantAddresses(ApplicantId, ResidentialAddress, City, ResidentialStateId) VALUE (:newApplicantId1, :newResidentialAddress, :newCity, :newResidentialStateId)"
                  	args.set("newApplicantId1",ApplicantId)
                  	args.set("newResidentialAddress",ResidentialAddress)
                  	args.set("newCity",City)
                  	args.set("newResidentialStateId",ResidentialStateId)
                  	
                  	result = cn.Execute(sqlInsert,args)
                  	if result then
                  		message = "Record Successfully inserted"
                  	else
                  		message = "Record was not inserted"
                  	end if
                  
                  	cn.Close()
                  else 
                  	message = " Could not connect to Database"
                  end if
                  
                  dim aa as p
                  aa = e.rtc.A_AjaxResponses
                  aa[].text = "alert('"+message+"');"
                  aa[..].id = 100

                  Comment


                    #24
                    Re: initializing field

                    Originally posted by Davidk View Post
                    Hey Chinedu,

                    There are a couple of issues with your code.

                    1. You're dimming ResidentialStateId as a number but the data coming in from the grid is actually text - that's how it gets passed back. To ensure you're assigning what you want, convert where needed.
                    2. You have an error in the code that returns your javascript alert. You must include single quotes in order to properly quote your text.

                    I've changed the code a bit to make it a bit more readable. Also, use args.set instead of args.add. The .set "re-sets" or "adds".

                    The following code works in the AfterInsertRecord event...

                    Code:
                    dim cn as sql::Connection
                    dim result as l
                    dim args as sql::Arguments
                    dim sqlInsert as c
                    dim message as c
                    
                    dim ApplicantId as n = e.lastIdentityValue
                    dim ResidentialAddress as c = e.DataSubmitted.ResidentialAddress
                    dim City as c = e.DataSubmitted.City
                    dim ResidentialStateId as n = val(e.DataSubmitted.ResidentialStateId)
                    
                    result = cn.open("::name::Test")
                    if result then
                    	sqlInsert = "INSERT INTO ApplicantAddresses(ApplicantId, ResidentialAddress, City, ResidentialStateId) VALUE (:newApplicantId1, :newResidentialAddress, :newCity, :newResidentialStateId)"
                    	args.set("newApplicantId1",ApplicantId)
                    	args.set("newResidentialAddress",ResidentialAddress)
                    	args.set("newCity",City)
                    	args.set("newResidentialStateId",ResidentialStateId)
                    	
                    	result = cn.Execute(sqlInsert,args)
                    	if result then
                    		message = "Record Successfully inserted"
                    	else
                    		message = "Record was not inserted"
                    	end if
                    
                    	cn.Close()
                    else 
                    	message = " Could not connect to Database"
                    end if
                    
                    dim aa as p
                    aa = e.rtc.A_AjaxResponses
                    aa[].text = "alert('"+message+"');"
                    aa[..].id = 100
                    Thank you very very much for your time spent in helping me to achieved the lingered problem. But the issues am facing now, i can't update previous records added without address, it throws back an error message, have a look at it; Record was not updated because it has been deleted by another user.
                    How do i solve this problem now?

                    Comment


                      #25
                      Re: initializing field

                      this code will not work for updating, for that matter you may not need to write any code.
                      you should be opening the detail view from the grid, just fill out the data and the detail view on submit will update the secondary table.
                      if the tables are linked properly and opened from a grid it should work without any code.
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                        #26
                        Re: initializing field

                        Originally posted by GGandhi View Post
                        this code will not work for updating, for that matter you may not need to write any code.
                        you should be opening the detail view from the grid, just fill out the data and the detail view on submit will update the secondary table.
                        if the tables are linked properly and opened from a grid it should work without any code.
                        It doesn't update. You can try it, first have some records inserted for the a1 table and then create the a2 table with the code and test it.

                        Thank you.

                        Comment


                          #27
                          Re: initializing field

                          http://screencast.com/t/STUu4I0Yes
                          take a look, when I update it updates the secondary table, and when I delete it also deletes the record in secondary table.
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                            #28
                            Re: initializing field

                            I think you need to re-think what you need to get done with this grid. You have a parent/child relationship between applicants and applicantaddresses... a one-to-many design. I believe Gandhi's demo works because he's only working with 1 child record per parent. I have a feeling that you want to work with multiple child records per parent. Is this the case?

                            Comment


                              #29
                              Re: initializing field

                              Originally posted by Davidk View Post
                              I think you need to re-think what you need to get done with this grid. You have a parent/child relationship between applicants and applicantaddresses... a one-to-many design. I believe Gandhi's demo works because he's only working with 1 child record per parent. I have a feeling that you want to work with multiple child records per parent. Is this the case?
                              Yes DavidK. I have a parent/child relationship, and am using the SQL select statement to filter and join the table with LEFT OUTER JOIN. It a one-to-many relationship. Which the parent ID needs to be inserted as a foreign Key to the child tables. I have four child tables I want to insert into using Detail view as a single form.

                              Thanks

                              Comment


                                #30
                                Re: initializing field

                                may be I missed the whole thing in the last 29 posts. I never realized that you have four child tables, not clear to me.
                                if you can post an example diagram of parent and child tables one of us will be able to help. I am sure.
                                thanks for reading

                                gandhi

                                version 11 3381 - 4096
                                mysql backend
                                http://www.alphawebprogramming.blogspot.com
                                [email protected]
                                Skype:[email protected]
                                1 914 924 5171

                                Comment

                                Working...
                                X