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

UX Populate Data from other Tables

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

    #16
    Re: UX Populate Data from other Tables

    okay now I get it.
    if that is what you want you cannot use the alpha supplied stock populate from table action script as far as I can tell, but can easily be done by yourself creating an ajax callback function to do.
    if you are unsure of doing it post back I will post a screencast and give you the code to do it.

    I know you addressed this to david. he may do it before I.
    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: UX Populate Data from other Tables

      Hey Chris,

      If you'd like to post a sample grid/ux using your current method then we could have a look. I put together a solution based on your video... you didn't mention that you had changed tactics.

      Have you tried to null out the autonumber after the copy?

      Comment


        #18
        Re: UX Populate Data from other Tables

        Hi Both

        I have tried to null out the ipm_id (this is the autonumber field) with {dialog.Object}.setValue('ipm_id',''). This runs after the data has been populated.

        Very confused

        Thanks

        Chris

        Comment


          #19
          Re: UX Populate Data from other Tables

          okay
          take a look at these videos, hopefully this is what you want. post back if not.

          Part 1:
          http://screencast.com/t/wE5zV5yuv

          Part 2:
          http://screencast.com/t/cx7wbljE52I

          here is the code that does what I have shown, I have created a control "populate" and this runs on the onClick event of that control.

          Code:
          function populate as c (e as p)
          	
          	
          	'debug(1)
          	dim id as n
          	id = e.dataSubmitted.customer_id
          	dim cn as sql::Connection
          	dim args as sql::Arguments
          	dim result as l
          	dim rs as sql::ResultSet
          	
          	result = cn.Open("::Name::local_MYSQL")
          	if	result
          		dim sqlSelect as c
          		sqlSelect = "SELECT * FROM customer WHERE id = :newId"
          		args.add("newID",id)
          		result = cn.Execute(sqlSelect,args)
          		if result
          		rs = cn.ResultSet
          		e._set.lastname.value = rs.data("lastname")	
          		e._set.firstname.value = rs.data("firstname")
          		e._set.address1.value = rs.data("address1")
          		e._set.address2.value = rs.data("address2")
          		e._set.city.value = rs.data("city")
          		e._set.zipcode.value = rs.data("zipcode")
          		e._set.date_of_birth.value = rs.data("date_of_birth")
          			
          		end if
          		
          		
          	else
          	populate = "alert('could not connect to database');"
          	end if
          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: UX Populate Data from other Tables

            Hi

            I have tried to use this method but I have problems.

            1) Would the code be different if I was using SQL 2012 as nothing happens when I use this code not even an error and the data doesn't get read.

            function populate as c (e as p)

            debug(1)
            dim id as n
            id = e.dataSubmitted.ipm_id
            dim cn as sql::Connection
            dim args as sql::Arguments
            dim result as l
            dim rs as sql::ResultSet

            result = cn.Open("::Name::conn")
            if result
            dim sqlSelect as c
            sqlSelect = "SELECT * FROM rs.sen_ipm_header WHERE id = :newId"
            args.add("newID",id)
            result = cn.Execute(sqlSelect,args)
            if result
            rs = cn.ResultSet
            e._set.student_id.value = rs.data("student_id")
            e._set.ipm_review_date.value = rs.data("ipm_review_date")

            end if


            else
            populate = "alert('could not connect to database');"
            end if
            end function

            Also, I have multiple tables that feed the data to the UX - How would this look.

            Thanks

            Chris

            Comment


              #21
              Re: UX Populate Data from other Tables

              sqlSelect = "SELECT * FROM rs.sen_ipm_header WHERE id = :newId"
              rs.sen_ipm_header is this name of the table in msql 2012? does not look like it.
              Also, I have multiple tables that feed the data to the UX - How would this look.
              you need to clarify on that one.
              I will reread the posts so far, I am not sure this was revealed before.
              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


                #22
                Re: UX Populate Data from other Tables

                I see you said something in your first post like linking to few tables, not mentioned you need to pull info from many tables.
                If you post a dummy dialog and schematically represent what needs to be achieved that would be helpful.
                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: UX Populate Data from other Tables

                  senux.zip

                  Hi Ghandi this is the attached UX

                  Thank you so much for your help.

                  Chris

                  Comment


                    #24
                    Re: UX Populate Data from other Tables

                    Downloaded and opened
                    One of them seems to instructions for teachers and assistants to teachers
                    The second one seems the business end filling out data
                    Since the tables or the connection does not exist in my computer it throws error.
                    I just need you list few tables and what needs to be pulled to the dialog.
                    Or I can create 3 tables and a dialog and populate to show how it is done.
                    For the latter I will post back this evening dst USA.
                    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


                      #25
                      Re: UX Populate Data from other Tables

                      would you provide sample table to work with no data needed
                      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: UX Populate Data from other Tables

                        SEN SET.jpgBIND CONTROLS TO FIELDS.jpgSPECIFY.jpg

                        Ghandi

                        Please find the attached screenshots of the UX Setup and the table names and fields below.

                        They are joined in the SET with ipm_id.

                        Thanks so much

                        Chris

                        sen_ipm_header

                        [ipm_id] [int] IDENTITY(1,1) NOT NULL,
                        [student_id] [int] NULL,
                        [student_name] [varchar](30) NULL,
                        [ipm_start_date] [date] NULL,
                        [ipm_review_date] [date] NULL,
                        [ipm_provisional_date] [date] NULL,
                        [interests_strengths] [varchar](max) NULL,
                        [aon_bol] [varchar](max) NULL,
                        [targets] [varchar](max) NULL,
                        [target_tracking] [bit] NULL,
                        [outcome] [varchar](max) NULL,
                        [cognition_learning] [bit] NULL,
                        [communication_interaction] [bit] NULL,
                        [besd] [bit] NULL,
                        [sensory_physical] [bit] NULL,
                        [RA] [decimal](5, 2) NULL,
                        [SA] [decimal](5, 2) NULL,
                        [Eg] [varchar](2) NULL,
                        [Ma] [varchar](2) NULL,
                        [ipm] [bit] NULL,
                        [completed] [bit] NULL,

                        sen_ipm_ara

                        [ipm_ara_id] [int] IDENTITY(1,1) NOT NULL,
                        [ipm_id] [int] NULL,
                        [additional_recommended_adjustments] [varchar](max) NULL,

                        sen_ipm_progress

                        [ipm_progress_id] [int] IDENTITY(1,1) NOT NULL,
                        [ipm_id] [int] NULL,
                        [progress] [varchar](max) NULL,
                        [progress_tracking] [bit] NULL,
                        [progress_by_when] [varchar](20) NULL,
                        [progress_monitored_by] [varchar](20) NULL,

                        sen_ipm_provision

                        [ipm_provision_id] [int] IDENTITY(1,1) NOT NULL,
                        [ipm_id] [int] NULL,
                        [personalised_provision] [varchar](max) NULL,
                        [by_whom] [char](3) NULL,
                        [personalised_provision_when] [varchar](20) NULL,

                        Comment


                          #27
                          Re: UX Populate Data from other Tables

                          fantastic
                          now go back and take a look at my code in post #19
                          change that sqlSelect statement to

                          Code:
                          sqlSelect << %sql%
                          SELECT * 
                          FROM (sen_ipm_header sen_ipm_header
                          	 INNER JOIN sen_ipm_ara sen_ipm_ara
                          		 ON  sen_ipm_header.ipm_id = sen_ipm_ara.ipm_id
                          	 INNER JOIN sen_ipm_progress sen_ipm_progress
                          		 ON  sen_ipm_header.ipm_id =  sen_ipm_progress.ipm_id
                          	 INNER JOIN sen_ipm_provision sen_ipm_provision
                          		 ON  sen_ipm_header.ipm_id =  sen_ipm_provision.ipm_id )
                          WHERE id = :newID
                          
                          %sql%
                          this will give you every field in all the tables in the result set.
                          if that is not what you want
                          only select fields from each table
                          then the statement will be
                          Code:
                          sqlSelect = <<%sql%
                          SELECT sen_ipm_header.ipm_id, sen_ipm_header.student_name, sen_ipm_ara.additional_recommended_adjustments, sen_ipm_progress.progress, sen_ipm_provison.personalized_provision
                          FROM (sen_ipm_header sen_ipm_header
                          	 INNER JOIN sen_ipm_ara sen_ipm_ara
                          		 ON  sen_ipm_header.ipm_id = sen_ipm_ara.ipm_id
                          	 INNER JOIN sen_ipm_progress sen_ipm_progress
                          		 ON  sen_ipm_header.ipm_id =  sen_ipm_progress.ipm_id
                          	 INNER JOIN sen_ipm_provision sen_ipm_provision
                          		 ON  sen_ipm_header.ipm_id =  sen_ipm_provision.ipm_id )
                          WHERE id = :newID
                          
                          %sql%
                          obviously for the select fields I am using example fields, you can include as many fields you want.
                          then you can reach all the data with rs.data("your_field_name") as usual.
                          hope this helps.

                          ps: also between the end if and else statements please do not forget to add
                          cn.close()
                          Last edited by GGandhi; 03-20-2014, 07:08 AM.
                          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: UX Populate Data from other Tables

                            Hi Ghandi

                            This is the code I now have but I have a huge red error message:-

                            Can you spot any potential issues thanks

                            Chris

                            function populate as c (e as p)

                            debug(1)
                            dim id as n
                            id = e.dataSubmitted.ipm_id
                            dim cn as sql::Connection
                            dim args as sql::Arguments
                            dim result as l
                            dim rs as sql::ResultSet

                            result = cn.Open("::Name::conn")
                            if result
                            dim sqlSelect as c
                            sqlSelect = <<%sql%
                            SELECT *
                            FROM (sen_ipm_header sen_ipm_header
                            INNER JOIN sen_ipm_ara sen_ipm_ara
                            ON sen_ipm_header.ipm_id = sen_ipm_ara.ipm_id
                            INNER JOIN sen_ipm_progress sen_ipm_progress
                            ON sen_ipm_header.ipm_id = sen_ipm_progress.ipm_id
                            INNER JOIN sen_ipm_provision sen_ipm_provision
                            ON sen_ipm_header.ipm_id = sen_ipm_provision.ipm_id )
                            WHERE id = :newID
                            %sql%

                            result = cn.Execute(sqlSelect,args)
                            if result
                            rs = cn.ResultSet
                            e._set.student_id.value = rs.data("student_id")
                            'e._set.firstname.value = rs.data("firstname")
                            'e._set.address1.value = rs.data("address1")
                            'e._set.address2.value = rs.data("address2")
                            'e._set.city.value = rs.data("city")
                            'e._set.zipcode.value = rs.data("zipcode")
                            'e._set.date_of_birth.value = rs.data("date_of_birth")

                            end if

                            cn.close
                            else
                            populate = "alert('could not connect to database');"
                            end if

                            end function

                            Comment


                              #29
                              Re: UX Populate Data from other Tables

                              I don't see you set the argument
                              right after
                              %sql% but before result = cn.execute...
                              add
                              args.add("newId", id)

                              also if you need only those few fields just select the way I suggested in the second example.
                              also I don't see any address for the student in the tables you supplied.
                              you need to take that into account
                              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


                                #30
                                Re: UX Populate Data from other Tables

                                if you need only information from the student table you don't need to connect to other tables for populating
                                the select statement will be
                                Code:
                                sqlSelect = <<%sql%
                                SELECT * 
                                FROM sen_ipm_header sen_ipm_header
                                       INNER JOIN student_table_name student_table_name
                                                   ON sen_ipm_header.student_id = student_table_name.id
                                WHERE id = :newID
                                %sql%
                                args.add("newID", id)
                                this will give you all the student information. looks like you don't need other information from your last post.
                                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