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

ew grandchild records for parent

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

  • ew grandchild records for parent

    i have 3 table

    parent - casefile
    child

  • #2
    Re: ew grandchild records for parent

    ill start again

    parent - casefile
    child - products
    grandchild - commissions (there can be multiple commission activity for each product)

    the issue i am having is to view all commission records at parent level, everything else is fine in terms of adding grandchild records, viewing grandchild records at child level.

    At parent level, my browse is showing grandchild records but only for one child record at a time.

    i have tried all sorts, basing the form on different sets, just on the commissions table only.

    i had thought of adding a field to capture the id for the parent table and then filter based upon his, but i do not see how to pss the value from the parent table to the grandchild table. (the companion form is passing the value from the child table of course)

    i have spent about 6 hours on this and now it is time to concede to the power fo the message board.

    thanks

    Comment


    • #3
      Re: ew grandchild records for parent

      the issue i am having is to view all commission records at parent level, everything else is fine in terms of adding grandchild records, viewing grandchild records at child level.
      Huh?

      A detailed example of what you're trying to achieve will help us help you. Give us an example of a case, with products and commissions. Then show us how you want it to appear when "all commission records are at parent level".

      -- tom

      Comment


      • #4
        Re: ew grandchild records for parent

        If I understand correctly, you designed the set to cascade changes from parent to child and from child to grandchild, and you're now trying to make changes in the parent that will cascade through the child to the grandchild. Right?

        I may be completely wrong on this, but in my experience cascading changes typically leads to problems - particularly if you go through more than one level of cascading.
        I always design things so a change in the child table has to be done in a form that is directly linked to the table, and cascade changes the other way, child to parent. So the parent is importing data from the child tables, not exporting data to them. Normally, I do this with forms that open in popup windows.

        Others may have a much better view on things, though.
        It is easier to get older than wiser

        Comment


        • #5
          Re: ew grandchild records for parent

          A bit more info...

          no cascading changes, say i have a parent record for a customer and have added 2 products (child records).

          for these 2 products i have 2 grandchild records each, so a total of 4 grandchild records for the parent record.

          all i want to do is to be able to view all 4 grandchild records at the same time for the parent record.

          attached sample, login administrator - password = manager

          open form - fCaProdsEdit

          there is a browse for the child records products.
          there are 2 buttons.

          1. a small calculator in the corner of the browse. this is to add a commission to a child record (product)
          2. a larger button above titled 'view case comms' - this is to view all commissions (grandchild records) for each case (parent record)

          this is where my problem lies. i cant seem to view all grandchild records at the same time. this is to allow users to see all commission activity per customer not just per product sold.

          i hope this makes a little more sense.

          Comment


          • #6
            Re: ew grandchild records for parent

            Richard, yes, that makes much more sense. Unfortunately, I don't think you can do it in the same form you're describing. The set structure is wrong. Your grandchild table structure probably does not include a field that uniquely links to the parent table. Were such a field present you could use a new set in which the grandchild table is linked (as child) directly to the parent table. Using a form based on this new set you could step through the parent table records, and for each you would be able to see all the commissions records. In short, using the present set structure commissions are not linked to cases, so you can only see those commissions that are linked to products.

            Comment


            • #7
              Re: ew grandchild records for parent

              Thanks Tom,

              I had added a field to the grandchild table to accept the value of the linking field from the parent table to allow me to do as you explain.

              however i saw no way to pass the value from the parent table to the grandchild table.

              i was thinking that maybe i needed to base a form on a set which included all 3 tables. this would allow the value from the parent table to be available to the grandhild table. but i couldnt accomplish this either.

              ill keep plugging away, but if any ideas or solutions are out there, id be glad to hear them.

              thanks

              Comment


              • #8
                Re: ew grandchild records for parent

                Richard, (and Tom)

                There is a new function, for v8 (although it still hasn't made it into the documentation) for opening forms called form.viewlinked(). I will include the blurb from the 'Whats New in V8' page

                Form.ViewLinked() Method - This new method is similar to the .ViewQueried() method in that it opens a form showing selected records. However, with the .ViewLinked() method, you can specify how the target form (i.e. the form that is opened by this method) is linked to a parent table, and Alpha Five will automatically ensure that the correct values are entered into the linking fields when a record is edited or created, ensuring that the records edited/created in the target form remain properly linked to their 'parent' record.

                P formPointer = Form.ViewLinked (C LayoutName , C LinkDefinition [, C filter_expn [, C order_expn [, C style [, C x_position [, C y_position [, OtherOptions ]]]]]])
                OtherOptions.Restrict_Navigation = .f.

                Where:
                formPointer A pointer to the form that is opened.
                LayoutName The name of the form to open. This is called the 'target' form. LinkDefinition A CR-LF delimited list of link conditions in the form of: linkTableField = linkValue

                e.g.
                firstname = "john"
                lastname = "smith"
                Filter_expn An optional filter to apply (in addition to the filter implied by the LinkDefinition) when the target form is opened. For example using the sample LinkDefinition shown above, the target form is automatically filtered using
                firstname = "john" .and. lastname = "smith"

                If you only wanted to see records for John Smith where the transaction date was in January, you might specify a filter_expn of:
                month(transactionDate) = 1
                Order_expn An optional order expression. Style The style in which the target form should be opened. Options are: null - open as a regular modeless form, 'dialog' - open as a modal form, 'dialog_newrecord' - open as a modal form showing a new record, 'hidden' - hidden until the .show() method is called on the form pointer, 'hidden-dialog' - hidden until the .show() method is executed on form pointer (or some other method that causes the form to become visible, such as .new_record() is called). Default value is null. X_Position Left, Center, Right, Fill or an absolute position expressed in pixels. Default value is null, which uses the definition stored in the form layout. Y_Position Top, Center, Bottom, Fill, or an absolute position expressed in pixels. Default value is null, which uses the definition stored in the form layout. OtherOptions A dot variable. Currently supports a single property. OtherOptions.Restrict_Navigation. Indicates if navigation from record to record is allowed when the target form is opened. Typically, when the user is viewing the last record in a query and he/she navigates to the 'next' record, Alpha Five displays a new record. If you want to prevent the user from navigating to a new record, set this property to .t.

                Example:
                The following command opens the 'InvoiceItems' form and ensures that any records either edited or added are automatically linked to the correct parent record (which has an InvoiceNumber of 'INV1234'). Assume for demonstration purposes that the InvoiceNumber field in the target table (i.e. the table on which the target form is based) is called 'InvNum' (and not 'InvoiceNumber' as it might be called in the parent record).

                dim LinkDef as c
                LinkDef = "InvNum = \"INV1234\""
                dim p as p
                p = Form.ViewLinked("InvoiceItems",LinkDef)
                Considering that you now have a case ref field in the commision table
                with this you could do some thing like the following in a button on your form.
                Code:
                tbl = table.current()
                'get the case id from the parent
                caseref = tbl.case_id  ' sub in your field name for the parent table case id field
                'open the commision form forcing a link using the parent case Id value
                frm = form.ViewLinked("YourCommTable","case_Id="+quote(caseref),"","")   ' case_Id here is the field in the commision table
                The form opened in this manner will always force, wether new record or editing, the case id to be the value of the linking value.
                Tim Kiebert
                Eagle Creek Citrus
                A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                Comment


                • #9
                  Re: ew grandchild records for parent

                  Tim,

                  thanks so much.

                  i achieved this quite easily in access with this code entered into a forms 'before insert' event, and all i did was have the parent form open in hidden mode to allow the value to be passed.

                  the code was very much as this

                  With Forms![product tbl]
                  If Not IsNull(!productid) Then
                  Me.productid = !productid
                  End If
                  End With

                  i just couldnt see a way to include the case ref in alpha5

                  ill give this a go tonight.

                  thanks again.

                  Comment

                  Working...
                  X