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 Rules in Version 5

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

    Posting Rules in Version 5

    I have just finished converting a rental program from A5V4 TO A5V5. In V4 I had the following posting rules defined, but it doesn't seem to work in V5...

    rental equipment table has;
    status field (defaults to "Available")

    in the rental items table, i have the following fields

    status1 (defaults to "Rented")
    posting rule: go to rental equip and post "Rented" in
    status field if Close"X" (close=field, char 2, that is
    changed from "" to "X" when item is returned)
    'THIS PART WORKS IN BOTH VERSION, AS SOON AS I ADD
    TO THE RENTAL CONTRACT IT PLACES STATUS TO RENTED

    status2 (defaults to "Available")
    posting rule: go to rental equip and post "Available"
    in status field if Close="X"
    'THIS PART WORKS IN VERSION 4 - BUT DOESNT WORK IN 5 - NO MATTER WHAT I TRY, I CANNOT GET IT TO UPDATE STATUS TO AVAILABLE AGAIN ONCE I ENTER "X" IN CLOSE.

    THERE ARE SEVERAL PLACES IN THE APPLICATION THAT THIS IS HAPPENING. FOR EXAMPLE, I HAVE A REPAIR FEATURE THAT ALLOWS THEM TO CHECK AN ITEM OUT (ONE FIELD UPDATES STATUS TO "REPAIR" IF REPAIR CLOSE "X" & ONE FIELD UPDATES STATUS TO "AVAILABLE" IF REPAIR CLOSE ="X") THE "REPAIR" WORKS, BUT NOT THE UPDATE BACK TO AVAILABLE.

    It seems that in each situation, the original posting rule on a new item line works, but once saved and then changed (adding "X" in the close field), the posting rule doesn't fire. ANY IDEAS OR HELP?






    #2
    RE: Posting Rules in Version 5

    Would you put up the specific thing you're doing and the code that's used? I'm having a little trouble following.

    You go to the field rules for a table. And then in the OnSave event for the record you...?

    You aren't changing it and then maybe changing it back, are you? I could see that happening.

    Comment


      #3
      RE: Posting Rules in Version 5

      I'm not using code in the onsave event. I am so-so with xbasic code, have only started working with.

      I have gone to the posting tab in field rules and used the pre-defined line there to post my values. Seems that this rule is working on a new line item, but not on a line item being changed in the table I place a posting field rule for.

      I have a table (inventory) with a field status (char, 10) This field has a simple default of "Available".

      I have a second table (Rental items) with a three fields;
      status1 (simple default of "Rented"), status2 (simple default of "Available") and Close (char, 2 spaces)

      In the field rules for Rental Items, I have gone to the Status1 field and placed a posting field rule that says:
      table:inventory / field:status / if itmnumb=itmnumb / Replace / if: Close"X" / YES

      Also in the field rules for Rental Items, I have gone to the Status2 field and placed a posting field rule that says:
      table:inventory / field:status / if itmnumb=itmnumb / Replace / if: Close="X" / YES

      Then when on the rental screen, when adding a rental item, the first rule works - It goes to inventory and changes "Available" to "Rented". I place the itemnumb as being rented, but leave the "Close" field blank.
      However, in the new version, when I go back to the rental ticket and place a "X" in the close field of the line I added at the time of rental - the posting rule isn't working - it won't go over and change the inventory status back to "Available". This worked in A5V4, but doesn't seem to work in A5V5. I have several other areas where I use this principle of creating a "close" field that use to allow me to change the status from "Available" to whatever that table was designed to do (for example, I do the same thing with a repair table. logging an item out to repair status works when I add the item to the repair log, but won't change back when I check the item in by placing an "X" in the close field on the same line.

      Does this make more sense? I know I should do a code on Onsaverecord to post the "REnted", and then a "Onchangerecord" code for once closed, but again - I'm not great with Xbasic. If you could help I WOULD SO APPRECIATE IT. I'm supposed to be installing the upgrade today and now my system won't fire.... THANKS AGAIN!!!!





















      Comment


        #4
        RE: Posting Rules in Version 5

        Lynda,

        In a 2 character field an 'X' may be preceded by a blank space if the user hits the spacebar.

        It will be followed by a blank space if the user leaves the field after typing X.

        [code]
        When testing for an exact match, there's a big
        difference in how your expression will be
        evaluated.

        if the field contains "_X" then Close = "X" will be false.

        if the field contains "X_" then Close = "X" will be false.

        if the field contains "x_" then Close = "X" will be false.

        if the field contains "_x" then Close = "X" will be false.

        Close = "X" will be true only if Close = "X"

        -- tom

        Comment


          #5
          RE: Posting Rules in Version 5

          Thank you for the response. I have tried this, using an alltrim(close)="X", but it doesn't work. It really does seem to be that once I save a line, whatever field rules posting applies (such as Close"X") works. However, changing the close to "X" on the same line (not adding another transaction) - doesn't allow the posting rule to fire. IE; the status2 field of if close="X" change back to "Available".

          Seems like I need to write an onchangerecord post rule, but again I unfortunately haven't mastered the xbasic code writing. Any other suggestions? THANKS AGAIN...

          Comment


            #6
            RE: Posting Rules in Version 5

            Whoops!

            if the field contains "X_" then Close = "X" will be false.
            if the field contains "x_" then Close = "X" will be false.



            No! In dBase variants, trailing spaces do not count when equality testing strings so:


            "X" = "X "
            "X " = "X "
            "x" = "X"
            "X" = "x "


            And so on. You can test it in the interactive window. It's probably a good thing, though it's always rubbed me the wrong way.

            ===Blake===

            Comment


              #7
              RE: Posting Rules in Version 5

              That's what I found also - not the two character.
              any other suggestions?

              Comment


                #8
                RE: Posting Rules in Version 5

                What I would suggest is to copy the database to a scratch area and reduce it to just the parts causing the problem. Then upload it, we'll see if we can reproduce here, and if so, we can forward it on to the A5 team as a bug.

                As far as using the field posting rules, no, that seems to be the proper place for what your doing. Or a proper place anyway. However, since it's not working:

                I suggest creating a temporary "dummy" form involving the table that's getting updated. Put a button on there, and use action scripting to get it do what you want. Then, take the generated XBasic and put it into your onSave code. That'd be easy to work out in the phorum.

                Comment


                  #9
                  RE: Posting Rules in Version 5

                  Thank you, I will get an upload ready and send out...

                  Comment


                    #10
                    RE: Posting Rules in Version 5

                    Just to add a quick note - One of the post features I have is a "Void" X on the same line. Again same problem. If I place an item on contract and then instead of deleting for audit purposes, I created a "Void" field (also char,2) that if I change to "X" would take off the contract and then also allow stauts2 ("available") to change item in inventory back to "Available". AGAIN NOT WORKING ONCE LINE ITEM SAVED THE FIRST TIME.

                    I Just went to rental items, and instead of changing the Void to "X" on the same line of item on contract - I added a second line that called the same item and this time placed void to "X" at original entry before saving. This posted "available" to status like it is supposed to.

                    This doesn't solve the problem in all areas, and I wouldn't know how to filter the first line item off the contract because it isn't marked as "Void", but thought it may help in understanding what is happening. Seems to definitely break down when changing an existing item vs. a new entry. Is there a reason a post won't happen on a changed item?

                    Comment


                      #11
                      RE: Posting Rules in Version 5

                      Lynda,

                      Just a suggestion, instead of using X and field rules use a check box and then have OnChange event action. This will give you and the user better control.

                      Keith Hubert
                      London.
                      Regards
                      Keith Hubert
                      Alpha Guild Member
                      London.
                      KHDB Management Systems
                      Skype = keith.hubert


                      For your day-to-day Needs, you Need an Alpha Database!

                      Comment


                        #12
                        RE: Posting Rules in Version 5

                        Blake, this is news to me! I have no experience with variants, and this result runs counter to my 'training'. Will have to play with it and ruminate on it, too.

                        -- tom

                        Comment


                          #13
                          RE: Posting Rules in Version 5

                          sounds like what I thought, I'd have to write the xbasic code in the onchangerecord event. I however am not good with xbasic yet, i've read and created the checkbook application using Dr. Wayne's book "application programming", this has helped me to understand the code when i read it, but still struggling with knowing how to setup from scratch.

                          How would you write the onchange event to post a field's value to a field in a different table? Any suggestions...

                          Comment


                            #14
                            RE: Posting Rules in Version 5

                            I went to onchangerecord for the rental item table and placed the following code.. didn't work, but am i close? the idea is onchange, if the Void field in rental items="X", then change the status field in inventory to what is in finstatus field of rental items (which defaults to "Available")...

                            dim inventory as p
                            dim rent as p
                            inventory=table.open("equip_invtry")
                            rent=table.open("rent_iym")
                            void=rent.void
                            if void="X" then
                            inventory.change_begin()
                            inventory.Status=rent.Finstatus
                            inventory.change_end(.t.)
                            end if
                            end


                            probably way off, but thought i'd try something...

                            Comment


                              #15
                              RE: Posting Rules in Version 5

                              Lynda,

                              Try and do what you want to with Action Scripting. It is childs play just like playing with building blocks. Think of what needs to be done and select the Action. If more instructions are needed the dialogs will ask for your options. You can add many actions into one script. No need to struggle with writing code, let Alpha do that for you. That's what you have paid for.

                              Keith Hubert
                              London.
                              Regards
                              Keith Hubert
                              Alpha Guild Member
                              London.
                              KHDB Management Systems
                              Skype = keith.hubert


                              For your day-to-day Needs, you Need an Alpha Database!

                              Comment

                              Working...
                              X