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

Posting to another table

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

    #16
    Judith, if you're looking for a batch operation Ted is on the right track. If you're looking for something that happens when the user marks an invoice paid in one table, but wants that stored in a second table, too, here's an easy example. Hope this helps. Start by opening Form A


    For_Judith.zip
    Attached Files

    Comment


      #17
      Sorry, Tom, I tied that method originally and it only works if the whole record is entered - including the .t. in the true/false box. Ticking Paid later doesn't trigger the post.

      I do not understand the logic of flagging an invoice as Paid in a separate table as somewhere and sometime ONE of them has to be tagged as Paid.

      What I believe Judith is asking for is a list of invoices which can be flagged as Paid and when that happens, write the fact to a separate table which also holds the invoice numbers.
      That's what her MD has asked for.

      Judith, could you elaborate please as maybe Append might work better in this instance?
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #18
        Ted, permit me to quibble. The post field rule fires only when the record is saved. It is not triggered when the onchange event of a field object fires. i.e. by ticking the field object

        In my example if you create a new record in FormA but leave inv_pd field empty the post fires when the record is saved... but does nothing because (a) there's no corresponding record in tableB; and (b) there's no value in in the inv_pd field to be posted. If you then create a corresponding record in TableB, but leave inv_pd blank, the post will occur if you go back to FormA and change the record by supplying a value to inv_pd.

        This is a limitation of the post field rule. It fires only when user is entering data from the keyboard and a new or changed record is saved.

        From the help: When you use a posting Field Rule, the posting occurs during data entry each time you enter a new record or change a record. Target field values are always up-to-date. Contrast this with using the Post Operation, in which a batch processing operation is performed. All matching values for multiple records are posted when the operation is run.

        Post operations performed with field rules only occur when data is input through an Alpha Anywhere form or browse, not through an Xbasic operation or Web Application.

        Comment


          #19
          Yes you are correct Tom.
          The implication is though, that invoices are entered as unpaid, and when paid as by .t. entry, table 2 is updated.
          That's the problem as I see it.
          See our Hybrid Option here;
          https://hybridapps.example-software.com/


          Apologies to anyone I haven't managed to upset yet.
          You are held in a queue and I will get to you soon.

          Comment


            #20
            Ted, we may (or may not) be saying the same thing. I share your concern with the app design. However, the post field rule is working just fine, within its limitations.

            Comment


              #21
              Yes indeed. Ther Post rule is doing what it should. I tried adding a conditional comment in an Action Script to fire the post but it ignored it and fired anyway.

              I showed the option of putting a Set together with the data from the input and result where the .t. could be entered, but that isn't quite what Judith seems to require.

              In some Local Authority apps, I have a billing and payments reconciliation method which compares the income and outgoings with the bank statements.
              That way we can see the actual bank balance, the amount available (on hand less cheques issued) and the amount available in the future (on hand less cheques issued plus invoices raised).

              The finances have to be accounted for publicly and are scruitinised monthly, so need to be adequately policed.

              I think we both know how to do this, but everyone has a boss (as my wife says).
              See our Hybrid Option here;
              https://hybridapps.example-software.com/


              Apologies to anyone I haven't managed to upset yet.
              You are held in a queue and I will get to you soon.

              Comment


                #22
                Seems to me an Update operation is needed, not a Post operation.
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #23
                  Originally posted by Judith View Post
                  Hi Ted,

                  Thank you for getting back to me. I used the posting tab in the field rules, I selected the table to be posted to - invoices - and the field 'Clear' to be posted to. I then selected the target linking field as the invoice number and the source linking key as the invoice number and the operation to Replace with the condition .T. (True).
                  When I try to enter a new record I get an error message, Cannot post to table INVOICES. Post rule is not valid. I can't figure out why it wouldn't work?
                  Judith

                  Here is an image of the field rule that Tom Cone provided in his example.

                  I adjusted the width of the columns to show the entire field rule.

                  Can you do the same for the field rule that gives the error message that the rule is not valid?

                  Or upload an example that shows it, but leave out sensitive information.

                  We can work out the issues if more information is provided.

                  These threads go on forever without examples. TonConePostingFR.jpg

                  I'm thinking the issue is that you are trying to post to a logical field using the value in the condition instead of having a logical field in both tables.

                  The condition column is not the value that is posted into the target table.
                  Last edited by Al Buchholz; 12-09-2021, 12:48 PM.
                  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


                    #24
                    Sorry everyone, I hadn't received any notifications to say there were further threads on the topic, I will read through them all and get back to you.

                    Comment


                      #25
                      I posted this about 6 hours ago and it didn't stick.

                      Posting Test01.zip

                      Try this as an Update.
                      It takes variables from the primary form and updates the target form when "PAID" is changed.
                      You can add invoice numbers to the target data set, so you can trace changes.
                      ​​​​​​​
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment


                        #26
                        Hi Everyone,

                        I have read through all the posts and opened up the tables people have sent me. The penny has dropped, for posting to work I would need a logical field on the payment table so that it would post to a logical field on the invoice table. Is that right? I was trying to post asking Alpha to use a numeric field as the point of entry and compare the invoice number in each table and then post true in a logical field in the invoice table.

                        I have solved the problem by creating a script that runs at the end of each day which posts paid on the invoice table if the invoice number on the payments table matches the invoice number on the invoice table. It appears to be working fine.

                        Thank you everyone for your help.
                        Jude



                        Comment


                          #27
                          Glad you have a solution and it will work as it runs against the whole data set.
                          Doing it record by record is possible using Update but I found changing one logical field problematic on its own.
                          Anyway, as long as it works, happy days.
                          See our Hybrid Option here;
                          https://hybridapps.example-software.com/


                          Apologies to anyone I haven't managed to upset yet.
                          You are held in a queue and I will get to you soon.

                          Comment


                            #28
                            Judth

                            You can build a cansave event for the form ( or in a field rule cansave for the transaction table) that uses action scripting that calls the update operation and filters for the invoice number.
                            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


                              #29
                              Yep. My basic demo didn't link it to the OnSave.
                              I think thats what I'd do.
                              The end of day process would sweep up any issues.

                              In my Accounts apps, I have a complete rebuild operation which sorts stuff out when a user gets trigger ( keyboard) happy.
                              Sometimes rapid data entry can cause issues at the PICNIC end, so this approach can help.
                              See our Hybrid Option here;
                              https://hybridapps.example-software.com/


                              Apologies to anyone I haven't managed to upset yet.
                              You are held in a queue and I will get to you soon.

                              Comment

                              Working...
                              X