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

copy child records to a single table record

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

    copy child records to a single table record

    Does anyone have a script that would take all invoice header child records and combine to a single invoice header record in a new table? example: CHILD1,CHILD2,CHILD3 goes to Field1,Feild2,Feild3 of new invoice header record #1.
    I am trying to take Many records to One record with the key being the same invoice header field.

    #2
    RE: copy child records to a single table record

    Kerry,

    Are you saying you want to take i.e. 100 child records, combine them together into one parent record? Perhaps you can explain a bit more?

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


      #3
      RE: copy child records to a single table record

      Kerry,

      To do such a thing one would need a table structure in the invoice header table that had enough fields in each record to accommodate all the fields in all the linked child table records. i.e. if each child table record has 6 fields, and you have up to 20 linked child table records for any one header record, your table structure would have to contain at least 100 fields (5 x 20). Presumably you wouldn't need to copy the link field value in each child table record, right?

      As soon as you do this Murphy's law will result in a transaction coming along that has 21 items which won't fit without increasing the structure of the header table by 5 more fields.

      I'm perplexed that you would ever want to do this. Care to explain a bit what's going on?

      -- tom

      Comment


        #4
        RE: copy child records to a single table record

        If you do a search in the alpha five help.chn for "Copy operations" you will find an explanation of esactly what you want to do. (I think) It will copy parent and child records to one record in a single table

        Russ

        Comment


          #5
          RE: copy child records to a single table record

          Russ

          What I see is a copy of a set to a single table. That's different from what Kerry is looking for. If there is something else, please tell me.

          Kerry

          I'm with Tom. Ware you doing this and is there a better way to do it?
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


            #6
            RE: copy child records to a single table record

            I have Shop Floor planner routing info in my child record tables along with other header info. The max child record per each header is 21 records of line items. I would like to take these 21 records no greater than 30 and create one master record with all. Each child record consists of only 8 fields and 6 header fields total. This adds up to be 246 fields for my master table. Now I need a script that will only read the child table and store like header-child record info into its individual record of the master table.

            Thanks For Your Help

            Comment


              #7
              RE: copy child records to a single table record

              Kerry,

              Thanks for the additional detail on 'what' you want to do, how about some info on 'why' ? I ask because your plan will place the data in positions where it will be more difficult to use with Alpha Five than in the present Parent Child set.

              -- tom

              Comment


                #8
                RE: copy child records to a single table record

                Kerry,

                I see no one has offered a script, and you haven't replied with additional information. Hopefully this means you've got it licked.

                The code for this kind of thing is not rocket science, but it's tedious. In pseudo code it would go something like this:

                1) Open the target table, begin a new record
                2) Open the header table, fetch the desired header
                record, assign field values from it to the corresponding
                fields in the pending target table record
                3) close the header table
                4) Open the child (items) table; run query to find all
                records that have the desired field value that links them to the previously selected header record; fetch the first record; assign field values from it to the corresponding fields in the target table; fetch the next, assign field values to the corresponding fields in the target table; continue until you hit end of file.
                5) close child table
                6) close target table

                -- tom

                Comment


                  #9
                  RE: copy child records to a single table record

                  Kerry,

                  Here's an example that can handle up to 4 linked items records in the child table.

                  It's the MakeFlat script you'll find on the code page in the control panel.

                  -- tom

                  Comment


                    #10
                    RE: copy child records to a single table record

                    Thanks Alot for the script, it works just fine. All I need to do now is change the script to read all the records instead of asking for certain records.

                    Comment


                      #11
                      RE: copy child records to a single table record

                      Kerry,

                      You're welcome. Good luck finishing it up, let us know how it turns out.

                      -- tom

                      Comment

                      Working...
                      X