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

Pulling Data From Parent DB

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

    Pulling Data From Parent DB

    I am pretty new to forums, and not very experienced with A5, so bare with me...

    I have a set with a CLIENT.DBF as the primary, the WO.DBF as a one to many child of the CLIENT.DBF and an EVENT.DBF that is a one to many child of the WO.DBF. I guess you could call that a nested one to many link. The link between the CLIENT.DBF and the WO.DBF is a common CLIENT_NUMBER field, and the link between the WO.DBF and the EVENT.DBF is a common WO_NUMBER field.

    I am trying to get the LAST_NAME field in the EVENT.DBF to automatically fill itself with the contents of the corresponding LAST_NAME field from the CLIENT.DBF. I have tried using a default expression and skip expression, I have tried to use a forced lookup table, etc. It seems like I am missing something simple, but I just can't figure out how to retrieve the data from the CLIENT.DBF when entering data into the EVENT.DBF even when working in a region within the set's form.

    Any help would be greatly appreciated.

    #2
    RE: Pulling Data From Parent DB

    Mike, I've done this on rare occasions, using code which pulls the desired field value from objects on the current form, and passes it to a second form where the new record is being entered.

    However, most avoid storing redundant data in child and grandchild tables, in order not to have to edit multiple tables when field values change later on. A change made to the parent table would require corresponding changes in the grandchild table, for example, if a person's last name changed.

    -- tom

    Comment


      #3
      RE: Pulling Data From Parent DB

      Tom has a point about last names possible changing.I might think about saving a unique customerID instead.

      The default field rule with a lookupc function and a skip rule could do it.Use the option "end of entry".
      In this case the lookupc would be almost a nested lookupc function.Here's the sytnax in a situation where a field gets a transaction and a field on the transaction gets a name:

      LOOKUPC("F",LOOKUPC("F",Poltrxid,"agent","policyh.dbf","trans_id"),"agent_name","agents.dbf","agent")

      Comment


        #4
        RE: Pulling Data From Parent DB

        To Mike:

        I agree with both Tom and John - more particularly with John's sugestion of a client ID for the link, rather than a name.
        A good way to look at the lookupc() function is that at the time of data entry into the child/grandchild fields, the parent has already been 'saved' and its indexes updated. That means that any field in that parent record would be available for transfer with the lookupc() function - with the field rule method. Charlie Crimmel has a method to this end using variables, somehow, but I didn't understand it and stayed with John's method.

        To John:

        John have you noticed any stalls or pauses during data entry [while lookupc() processes] with your method used against a very large parent table? I've only tested the method on a relatively small parent table and have always wondered "How will this function when the parent table has 3k's of records?", for instance.

        Thanks to both in advance

        Ken

        Comment


          #5
          RE: Pulling Data From Parent DB

          Ken,
          If I remember, alpha made some improvements in this area when it went to 4.5
          It uses indexes, so on a form it should be barely noticeable.On a browse, I'm sure it would slow down paging up or down.
          John

          Comment


            #6
            RE: Pulling Data From Parent DB

            To John:

            Thanks, and Alpha On!

            Ken

            Comment


              #7
              RE: Pulling Data From Parent DB

              Mike:
              I do this a lot in my payroll application.

              And yes I keep redundant data in the history files.
              A lot of times I may have to go back 2 or 3 years after the job is over and pull data from history for legal purposes.
              Employee files change and wage information changes. I need to be able to see data as it was originally keyed in.

              The way I do it is:
              When I select the name in the parent record,I write the information to global variables.
              Then in the data entry field rules of the child or grandchild record I have a formula that checks:
              If(first_name="",var->vfirstname,first_name)

              also check the box for default on entry.

              also the following code goes in the on activate and on fetch sections.
              'on activate
              dim global vfirstname as c
              dim global vlastname as c
              var->vfirstname=""
              var->vlastname=""
              t1-table.current(1)
              var->vfirstname=t1.first_name
              var->vlastname=t1.last_name

              the same code would go in the on fetch section




              charlie crimmel

              Comment

              Working...
              X