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

Linking Field Question

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

  • Linking Field Question

    When using a separate form (based on another table) for data entry, how does one get the linking field data from the parent table to the child table? I created the form based on the set but the the linking field data does not appear.

    This is my code:

    :Form.load("NewAcctEntrySF")
    :NewAcctEntrySF.new_record()
    :NewAcctEntrySF.show()
    :NewAcctEntrySF.activate()

    Thanks,

    kenn
    TYVM :) kenn

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

  • #2
    RE: Linking Field Question

    Hi Ken,

    You say the data entry form is based on another table.

    You also say the form is based on a set.

    Sorry, chief. You can't have it both ways. You have to come clean. Which is it?


    -- tom

    Comment


    • #3
      RE: Linking Field Question

      Ken,

      One simple way is to pass the value as an object value. Place the linking field for the child table as an object on the new child form. It can be hidden. For example purposes, suppose the link field is called "link". The default name for the field object will be "link". Now, you need to get the value for the link field from the calling parent record before you open the child form.

      tbl = table.current()
      org_link = tbl.link ' (assuming link is the field name in both tables)

      Add the following line after the new_record() line

      :NewAcctEntrySF:line.value = org_link

      This will fill in the object "link" with the value saved as org_link. You can also use global variables to pass the values, but I prefer this method.

      Jerry

      Comment


      • #4
        RE: Linking Field Question

        Ken,
        I'm assuming that you are entering a set's line items into a table but instead of directly entering them into an embedded browse you are opening a separate form for the record additions.( I like this method )

        You could define a global varaiable (v_invoice_no) and put the invoice number from the header recordin into this variable prior to opening the line item data entry form. In the "on enter" event of the form you could have something like:
        invoice_no.value = var->v_invoice_no
        John

        Comment


        • #5
          RE: Linking Field Question

          Tom,

          Sorry for the confusion. I've created two forms for T&E; one based on the set and one based on the child table only. The same code was palced on the buttons which open the forms.

          Additionally, the code opens two instances of the form so I 'ed out the show() on one and the activate() on the other. Now, only one instance of the form opens for each.

          Thanks,

          kenn
          TYVM :) kenn

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

          Comment


          • #6
            RE: Linking Field Question

            John,

            Close. The main form is based on the set and contains fields from the parent table as well as an embedded browse (w/only 3 fields, read only) from the child table. There are too many fields in the child table to efficiently do data entry in a browse so a dialog form is needed.

            Then, in edit mode of the child form based on the set,I created a global variable called v_case_numbr. In the form's OnEnter event, I placed case_numbr.value=var->v_case_numbr. I get no error messages but no case numbr as well.

            Thanks,

            kenn
            TYVM :) kenn

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

            Comment


            • #7
              RE: Linking Field Question

              Jerry,

              where does this go?

              tbl = table.current()
              org_link = tbl.link ' (assuming link is the field name in both tables)

              I placed it in the OnEnter event of the case_numbr field of the child form. (Link field in both tables is: case_numbr)

              I get the error message: :NewAcctEntrySF:line.value = org_link not found. Obviously I haven't put this where that should be.

              Thanks,

              kenn
              TYVM :) kenn

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

              Comment


              • #8
                RE: Linking Field Question

                Ken, no apology is needed. There are several ways to pass information from one form to another. I can think of three, and there may be more:

                1) store the link field value in a global variable in the calling form; then declare the same global variable in the called form, and assign its value to the link field as new records are added there.

                2) load the called form, and before showing it, manipulate an object located on that form by assigning the link field value to it... then show the form. The value passed to the called form can then be assigned to the link field as new records are added there.

                3) arrange for the called form to 'look back' to the calling form, and retrieve values from objects on that form. This would be done in a script which runs when the called form is opened.

                This subject comes up from time to time. Maybe someone could demo all three approaches for the Code Archive... ?

                -- tom

                Comment


                • #9
                  RE: Linking Field Question

                  Ken,

                  Try this on the script that loads the child form:

                  tbl = table.current()
                  org_link = tbl.link
                  :Form.load("NewAcctEntrySF")
                  :NewAcctEntrySF.new_record()
                  :NewAcctEntrySF:link.value = org_link
                  :NewAcctEntrySF.show()
                  :NewAcctEntrySF.activate()

                  Of course, this will only work if table.current() returns the parent table, the linking field is "link" for both parent and child, and there is an object called "link" on the form for the child which refers to the child field link. I just tested this on some dummy forms and it works.

                  Jerry

                  Comment


                  • #10
                    RE: Linking Field Question

                    Tom,

                    Thanks,

                    Yes, I agree, a demo would be most helpful. I'm not sure I understand just how it's done. I want to take a run at it but can't get at it till later tonight or tomorrow. Heading to see the grandkids for the weekend. Fortunately, they've got a computer so won't have to go through withdrawals. I emailed my app so it's there already. I've got a 4 hr drive and, Hmmmmmm, wonder if I can email me???

                    Someday, maybe.

                    Thanks,

                    kenn
                    TYVM :) kenn

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

                    Comment


                    • #11
                      RE: Linking Field Question

                      I hope someone will take the time to demonstrate all three ways and place it in the code archives. I also have trouble with this, and usually end up piecing something together that works, but probably not using doing it "right".

                      TIA

                      Tom

                      Comment


                      • #12
                        RE: Linking Field Question

                        Tom, I don't claim that it's 'right' but check the code archive, for an example I've just created and posted.

                        -- tom

                        Comment

                        Working...
                        X