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 field data from parent to child

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

    copy field data from parent to child

    I am building a set which will produce invoices. I have built a one-to-many set. One of the fields(Payment_Method) in the parent set records the method of payment from my customers (ch=charge, cc=credit card, pp=prepaid). The "Payment_method" field is a character field with two places. Whatever is in the "Payment_Method" field determines how data in the child table will be manipulated. What I would like to do is automatically copy the data in the "Payment_Method" field which is in the parent table to a field named "Payment_Status" in the child table. Both tables will use the field "Invoice_Number" as the linking field. I have tried posting, lookups, and a whole variety of formulas. Nothing seems to work.

    The Parent table is called "Invoice Header" and contains the "Payment_Method" field. The child table is called "Invoice Items" (pretty creative names, eh!) and contains the "Payment_Status" field.

    I could copy and paste but it needs to be done automatically so that my employees can enter orders quickly and without thinking too much.

    Can somebody out there help me?

    Allen Krause

    #2
    RE: copy field data from parent to child

    Allen,

    Have a look in AlphaSports Customer Information Form. See how the Billing address is copied to the shipping address with the press of a button.

    You can do the same thing as calculated field.

    I am interested as to what changes you will make to each line item depending on the method of payment.

    RegardsKeith HubertGuild MemberLondon.KHDB Management Systems
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      RE: copy field data from parent to child

      Thanks, Keith:

      That isn't what I had in mind. All I need to do is have the data (two characters)from the "Payment_Method" field in the invoice header table automatically copy to the "Payment_status" field in the Invoice items table as I am taking or entering orders.

      Those items which are pre-paid by my customer and temporarily unavailable (backordered) are put in a separate field from those that are backordered and charged. This allows the invoice for both types of orders to look the same as far as the customer is concerned but carry diffent data for my purposes.

      Thanks

      Allen Krause
      Oshkosh Church Supply, Inc.

      Comment


        #4
        RE: copy field data from parent to child

        Allen,

        To me the key to your problem is understanding how the new child table record is begun. If you use a button push the button's onPush event script can read the field value right off the field object in your form.

        Tell us how you begin a new record in the child table using your form.

        -- tom

        Comment


          #5
          RE: copy field data from parent to child

          Thanks Tom:

          I am beginning the entry in the child table just like Alpha Sports does in the invoice form. Once I have filled out the data in the parent table known as invoice header (I fill in the Payment_Method field as a user entered field) I then move the cursor down to the child table known as invoice items. I would like the Payment_Status field to fill in as the cursor moves through the record, either as it enters the record or leaves it. If it is necessary for the cursor to pass through the Payment_Status field to accomplish this, I can set the form up accordingly.

          Thank,

          Allen Krause
          Oshkosh Church Supply-

          Comment


            #6
            RE: copy field data from parent to child

            Tom: Please keep it in simple terms. I got into Alpha 5 because I didn't need to know a lot of programming language.

            Thanks. Allen

            Comment


              #7
              RE: copy field data from parent to child

              Hi Allen,

              I do this sort of thing all the time.

              For the child table, in Field Rules go to the field you want the header information. Make the field a calculated field (in field rules - the first tab), and use a look up formula. The lookup formula will be based on the Parent table using the linking information as the key.

              Something like Lookupc("F",invoice_no,"Payment_Type","Parent.dbf","Index")

              Hope this helps.

              Dan


              Dan Blank Databases, Inc.
              Dan

              Dan Blank builds Databases
              Skype: danblank

              Comment


                #8
                RE: copy field data from parent to child

                Thanks Dan:

                I'm building the database on my home computer. I'll try this after work tonight. I'll let you know how things go tomorrow.

                Allen Krause
                Oshkosh Church Supply

                Comment


                  #9
                  RE: copy field data from parent to child

                  Hi Dan:

                  I was eager to try the line of programming you advised me on. When I got home from work tonight I tried it even before saying hello to my family. It worked! This was one of the major hurdles in designing the database.

                  I'd like to learn more about programming language in Alpha Five. Any suggestions?

                  Allen Krause
                  Oshkosh Church Supply

                  Comment


                    #10
                    RE: copy field data from parent to child

                    Allen

                    Have you tried these at the top of the page?

                    Other resources:
                    WebHelp,
                    Tutorials,
                    Applications,
                    Frequently Asked Questions
                    and
                    Newsletter Archive

                    There is nothing that I know of at UW_Oshkosh or at the technical college, but you could ask them.....

                    There's the conference in May, the books on the Alpha web site....
                    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


                      #11
                      RE: copy field data from parent to child

                      Hi Allen,

                      Glad it worked. (knew it would) I use this method to place customer id's in child records so I can see a history of things done for a particular customer. [like purchasing inventory, or see work done on a piece of equipment, etc]. In Auot Repair Apps I also place the auto id in child records.

                      Al gave you some great links to get started along with some great ideas. One other site is Dr. Wayne's Learn Alpha.

                      Also spend some time with Alpha Sports. There is a lot of useful expamples in Alpha Sports.

                      Enjoy A5, although you have been warned with every success it starts to become addicting!

                      Take Care,

                      Dan

                      Dan Blank Databases, Inc.
                      Dan

                      Dan Blank builds Databases
                      Skype: danblank

                      Comment


                        #12
                        RE: copy field data from parent to child

                        Hi Dan:

                        Suddenly the formula doesn't work! Everything worked fine for a while. Now it stopped working. The formula was still in the expression builder but when I clicked OK it said that "expression does not evaluate to a character value."

                        The formula that I used (which worked until today) was:

                        lookupc("f",invoice_number,"payment_method","invoice_header.dbf","invoice_number")

                        The child table is called "invoice items"
                        The field in the "invoice items" table that I was trying to place a lookup in is "payment_status" it is in the field rules for this field that I had the expression built.

                        The parent table that I was looking up in is called "invoice_header". The field in the invoice_header that I was trying to copy to the child table is "payment_method".

                        What's going on? I haven't changed anything. It just wouldn't look up any more.

                        Allen Krause

                        Comment


                          #13
                          RE: copy field data from parent to child

                          Hello Dan:

                          I hope that I'm posting this in the correct place in the string. I lost my dial-up just a moment ago so my first post might not have gone through. I just called Roadrunner to see what they offer.

                          In any case, I used the Norton GoBack to reset my system to where it was 2 days ago. The expression is the same but now it's working. I must have made some changes elswhere in the program that caused some conflict, or there was a virus, or whatever.

                          If you have any thoughts on this I'd appreciate your passing them on to me.

                          Thanks again,
                          Allen Krause

                          Comment

                          Working...
                          X