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

Copying entries to new DB on the fly

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

    Copying entries to new DB on the fly

    Hi, I am looking at populating entries to a new DBF file and am struggling on the design approach.

    Currently I have a set with FAXHEAD as parent and FAXITEM as child (one to many). I want to populate a new child table, POITEMS (one to many) with the entries going into FAXITEM if the entry in FAXHEAD is a PO (purchase order).

    I am looking a TRIGGERS and TRIGKEYS but am not sure yet which event to TRIGGER off when entering items in FAXITEM.

    In FAXITEM I have MESSAGEID, PARTID, QUANTITY, PRICE.

    Message ID is populated from parent automatically, the PARTID is entered via a lookup from Partnumber DB (child o/o from Faxitem).

    Quantity is entered from customer's request and price MAY OR MAY NOT be entered.

    In POITEMS (the new DBF) I want to populate:
    a field CONTROL_ID whose value is pulled from the Partnumber DB.
    Customerref and CUST_ID, held in FAXHEAD

    The purpose of the new new table is to provide control for outstanding orders and better inventory management, which currently is done semi manually.

    I had thought of expanding the number of fields in FAXITEM but this covers more than PO's and has data going back a long time. If I could copy the data from it and add the control ID value and ifno from header when I get a new PO it would then form a good base for what I want to do.

    Anybody done this or have strong suggestions?

    Steve



    #2
    RE: Copying entries to new DB on the fly

    Hi Steve,

    Is there any chance you could zip a copy of your application so we could have a look at it, this way I think we may get a better understanding of what you are trying to do and of ways to help.

    Keith

    Comment


      #3
      RE: Copying entries to new DB on the fly

      Keith,

      In the strict sense it is not an application. Just a SET.

      As it is not yet working, it is a bit difficult to send, plus the data is large. I have zipped up the DOC info for most of the dbs and SET and maybe you might understand more from this.

      I want to populate a record in INCOMPOC from FAX_ITEM when a new entry for FAX_ITEM is made, ie has been entered, ie F10 or CTRL ENTER. Also, some data will need to be copied from FAXHEAD and PARTNUM.
      I am going to try setting variables for each field that I want the data from, such that a trigger script on leaving the field will SET the variable with the field value

      My problem is, well one of them, what trigger do I use to call the script to copy the variables to the fields in INCOMPOC. It is a trigger that needs to fire when I leave the LAST value I have entered in FAX_ITEM. As I may or may not, have entered PRICE I am not sure which script trigger works with closing, or moving from a child record.

      Also, I haven't thought about what happens if I change a value in FAX_ITEM as to how the change gets copied across to INCOMPOC.

      The design of hanging INCOMPOC off INCOMPO is a first guess. I was playing around with this but I am not sure whether it should be off FAXHEAD2. INCOMPO has records added (even though it is just one field) if the entry is an incoming PO, which is what I want. That has been in place a long time, but its value is somewhat limited up to now.

      Now to see if I can attach the ZIP file

      Steve

      Comment


        #4
        RE: Copying entries to new DB on the fly

        Keith,

        I had some success in writing the scripts and some failures.
        It seems that setting the variables with the values I want to copy is no problem but writing them into the new table is more difficult.

        At first I used this script, or a shortened version, at %SYS_TRIG_REC_SAVE and got some message about nesting.

        I therefore used it on the SAVE trigger event for the price field. I had a few successes with an abreviated version which only entered a couple of character fields but now I am not sure of the Syntex. On the basis that variables are character fields, I imagine that the nuneric and date need some modification from. {TRIGKEYS {{ENTER}{%DATE}}}. In fact an error message did say there was an error. BUT WHAT IS THE SYNTEX? I tried a few variations without success. Also, for a numeric field it seems the character value will enter the numeric field correctly but how should it be done properly.

        The script below is not being entered at all currently.

        Also, do I have to write out "TRIGKEYS" each time I want to enter data.

        Are you familiar with the TRIGKEY syntax. There semm a limited amount of examples in the manual.

        Steve
        PS I am using V6.2

        Script Documentation for TEST4


        Keystroke Script Information

        Name : TEST4

        Description : Check save record script

        Macro
        {TRIGKEYS {{F10:2}}}
        {TRIGKEYS {ZINCOMPOC}}
        {TRIGKEYS {{F10}}}
        {TRIGKEYS {E{%MESSAGEID}}}
        {TRIGKEYS {{ENTER}{%PART_ID}}}
        {TRIGKEYS {{ENTER}{%CONTROL_ID}}}
        {TRIGKEYS {{ENTER}{%CUSTINDEX}}}
        {TRIGKEYS {{ENTER}{CTOD(%DATE)}}}
        {TRIGKEYS {{ENTER}{%POREF}}}
        {TRIGKEYS {{ENTER}{VAL(%QTYORDERED)}}}
        {TRIGKEYS {{ENTER}{%PRICE}}}
        {TRIGKEYS {{F10:2}}}
        {TRIGKEYS {ON}}

        Screen test : No

        Comment


          #5
          RE: Copying entries to new DB on the fly

          Have you gotten anywhere on this?? I'm just another user and have recently had to fool with trigkeys too.

          TJ Baker

          Comment


            #6
            RE: Copying entries to new DB on the fly

            Have you tried using "Debug a Script" from the scripts menu for testing your script?? It's helpful in determining just where things are going astray. Last night I made a script that does what you are trying to do, ie: add a new record to a child table using variables for the data source. Using Debug helped a lot.

            ""On the basis that variables are character fields, I imagine that the nuneric and date need some modification from. {TRIGKEYS {{ENTER}{%DATE}}}. ""

            I have found (from the V6 manual) that you need to strip the date separators from the DATE variable before writing the string to your new record.

            {SET�%Date,REMSPECIAL(%DATE)}

            Numerics appear to need no such treatment, just use the variable as is.

            Comment


              #7
              RE: Copying entries to new DB on the fly

              Thomas,

              Thanks. I have scanned the manual re the date but didn't come up with your gem. I will try that.

              I haven't done any more this week.

              I did try using the debug but found that when I zoomed the F4 key didn't seem to show the child data base screen.

              Today is a bad day for extending my test.

              Out of curiousity, what page was the date info on.

              Thanks Steve

              Comment


                #8
                RE: Copying entries to new DB on the fly

                Steve,

                I first worked on the script not as a trigger script so I didn't have to fool with trigkeys until after I got it basically working. It was during debug at this stage that I saw the date separators being entered into the date field of the child table. I found the REMSPECIAL(%DATE) stuff buried in a sample script "GOTYES" on page 18-123.

                After posting about debug I found that I had to enable debug from within the script {DEBUGON} for trigger scripts, and further noted that the script won't actually process until all the text of the script has passed through the debug window. Even so, it was helpful, showing me where I had incorrect levels of braces and such.

                Comment


                  #9
                  RE: Copying entries to new DB on the fly

                  Thomas,

                  Ok the date is OK but I am having trouble getting the script to complete.

                  Didn't know if it was because I had too many TRIGKEY statements instead of stringing the commands together. After stringing the commands in a single TRIGKEY things went further but it didn't complete without an errot message. Haven't had the chance to systematically reduce the amount of entries I am copying in the script. I can't readily see a typo and the debug doesn't help.

                  It maybe the weekend before I can attack it with a fresh brain.

                  Currently the script is
                  Script Documentation for SPRICE


                  Keystroke Script Information

                  Name : SPRICE

                  Description : Sets variable %Price = price

                  Macro
                  {DEBUGON}
                  {SET %price, FAX_ITEM-"PRICE}
                  {TRIGKEYS {{F10:2}}}
                  {TRIGKEYS {ZINCOMPOC}}
                  {TRIGKEYS {{F10}}}
                  {TRIGKEYS {E{%MESSAGEID}}}
                  {TRIGKEYS {{ENTER}{%PART_ID}{ENTER}{%CONTROL_ID}{ENTER}{%CUSTINDEX}{ENTER}
                  {%DATE}{ENTER}{%POREF}}}
                  {TRIGKEYS {{ENTER}{%QTYORDERED}}}
                  {TRIGKEYS {{ENTER}{%PRICE}}}
                  {TRIGKEYS {{F10}}}
                  {TRIGKEYS {ON}}

                  Screen test : No

                  It seems to bomb out at 4 lines from bottom, when F10ing with debug. I did have F10:2 2 from bottom but tried just F10 and it still bombed.

                  Are well until the weekend, or until I try before a beer.

                  Steve

                  Comment


                    #10
                    RE: Copying entries to new DB on the fly

                    Steve,

                    Have you altered the structure of the INCOMPOC dbf since uploading your zip file of the database???

                    The field types shown in INCOMPOC.DOC do not match the field types you are trying to enter in the script. Specifically the DATE field is the 4th field in the dbf but %DATE is the 5th field your script is entering. The IMCOMPOC.DOC contains no form information, I am assuming you are using the default form. If this is the case the script is trying to enter the %CUSTINDEX variable into a date field which might be causing the trouble.

                    Also there is no PRICE field in the INCOMPOC.DOC file, maybe you have changed that table (dbf)???

                    Comment


                      #11
                      RE: Copying entries to new DB on the fly

                      Thomas,

                      Thanks for the feedback. I will try and find time tomorrow night to check your thoughts. Just off to bed now.

                      Steve

                      Comment


                        #12
                        RE: Copying entries to new DB on the fly XLOOKUPRW

                        I want to thank Keith George for helping me by private email.
                        He alerted me to the script XLOOKUPRW which is documented in the manual and this seems to do exactly what I want. It seems there is only one mention of this cript on this message board so just in case it will help somebody else I will mention it here.

                        Thanks again Keith

                        Steve

                        Comment


                          #13
                          RE: Copying entries to new DB on the fly XLOOKUPRW

                          Steve,

                          I thought you were trying to add a new record to a dbf file?? As far as I found XLOOKUPRW does not do this. How has this solved your issue???

                          Comment


                            #14
                            RE: Copying entries to new DB on the fly XLOOKUPRW

                            Steve,

                            Disregard my last post. I have since read the thread you mentioned and when I looked in the manula THIS time I saw the $NEW$ parameter. I have previously looked into this but missed that useful tidbit. Now THAT looks interesting!!

                            Comment

                            Working...
                            X