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

Field Rule Lookup Table

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

    Field Rule Lookup Table

    We have a field "towncode" in one of our tables (inst_inq) that has a field rule lookup table.

    When we defined the lookup, we specified "g:\bcbss\towncode.dbf" as the table to look up into.

    The inst_inq table is in a different folder than the towncode table. "g:\medicaid\inst_inq.dbf"

    When we open up the field rules to look at the lookup table definition, the "g:" is missing.

    on a non-shadowed system, the lookup works just fine, even without the "g:".

    On a shadowed system, when the user tries to change the field, an error is thrown stating that the lookup table could not be found "C:\bcbss\towncode.dbf".

    In a perfect shadowed world, the lookup would go to "c:\shadow\G\bcbss\towncode.dbf" (c:\shadow\G) is the location of our shadowed systems)

    All attempts to redefine the field rule definition have failed in getting the "g:" to stick.

    I've included screenshots of the field rule definition as well as the error.

    Any and all help would be appreciated.

    Thanks,

    Tom
    Attached Files

    #2
    Re: Field Rule Lookup Table

    Tom, You did say "Any and all" and no one else has responded yet so here is an idea which may not be practical but if your desperate....

    Have the system check if it is running shadowed.
    If it is then use xbasic to alter the field rule to prefix "\shadow\G" to the path. (the system seems to be defaulting to c:\)

    Not having worked much with shadowed systems I don't know if the field rules are stored locally as part of the shadow process. I thought they did. If so this might work.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

    Comment


      #3
      Re: Field Rule Lookup Table

      Thanks, Tim.

      We already check to see if we're shadowed.

      I had no idea that you could modify field rules with x_basic. I will look into that.

      Tom

      Comment


        #4
        Re: Field Rule Lookup Table

        Would it be possible to include the lookup table into the workspace?
        Never tried this with a table on another system. Just asking.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: Field Rule Lookup Table

          Have you tried defining the lookup at the form level? Don't know if that would make a difference or not - but the shadow does have its own local copy of the form.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: Field Rule Lookup Table

            Here's an example of changing a field rule using xbasic.

            Code:
            'use xbasic to set Data Entry field rules for field "Transno"
            dim p as p
            p=table.open("fm_equip",file_rw_exclusive)
            
            rul=p.rules_get()
            rul.change_begin()
            'rul.transno.Data_Type = "user"
            rul.transno.Data_Type = "AutoInc"
            rul.change_end(.t.)
            p.close()
            
            ui_msg_box("","done")
            
            end
            Alpha 5 Version 11
            AA Build 2999, Build 4269, Current Build
            DBF's and MySql
            Desktop, Web on the Desktop and WEB

            Ron Anusiewicz

            Comment


              #7
              Re: Field Rule Lookup Table

              Another thought...In v11 I have had some problems in the past when trying to change the lookup table. What I did to fix it was delete the rule, save the table and close, compact and then reopen and add the rule back. That either blanks the rule or brings up the prompt to delete the old fill info when I select another table. If you are not getting the prompt, apparently Alpha won't delete the old info.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #8
                Re: Field Rule Lookup Table

                Robin,

                Thanks, but I've tried that and I have a feeling that there is something remaining even after the rule is deleted.

                My next thought is to copy the data and indexes and rebuild the rules in the new table. This table has a LOT of field rules, and I really don't want to re-do all those rules.

                To me, this seems like some sort of FLAW in the software if it loses the drive definition.

                This happens even in ver 10.5

                Tom

                Comment


                  #9
                  Re: Field Rule Lookup Table

                  Sounds like the drive value is hard copied into the a5 code. A few versions back you couldn't move a desktop application off the C drive with confidence that it would run properly.
                  Just a thought: How about trying to assign/use an alias to point/map to the other drive? (system settings)

                  Just saw this new link here in forum on how to use an alias: http://www.alphasoftware.com/alphafo...w-To-Use-alias
                  Last edited by SNusa; 02-21-2016, 07:33 PM.
                  Robert T. ~ "I enjoy manipulating data... just not my data."
                  It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                  RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                  Comment


                    #10
                    Re: Field Rule Lookup Table

                    Robert,

                    We use this table for lookups in numerous databases. We have a very complex system with applications all in separate folders on a main server drive "G". We've been running this way for over 15 years. It is only THIS one particular field rule in this particular table that is giving us an issue.

                    Comment


                      #11
                      Re: Field Rule Lookup Table

                      Hi Tom;

                      That is odd. I think you're "ahead of me" on the alpha curve, but I sometimes overlook the obvious with "screen burned eyes."
                      What's happening in the trace window and the script recorder when you're using this field? How about when you're simply setting it up/editing/saving or reviewing the table field rules themselves? Anything strange happening on this one as opposed to when you assign G to the other one? You might just see something happening there there that will give you additional insight.

                      If you don't see anything out of the ordinary there, maybe you could open the file (at different times) that contains the field rules with an external program like a spreadsheet viewer to see when this assignment is actually loosing the "drive designator?" (G) ~ Granted, this I've never tried (on the file that contains field rules), but many of the a5 related files can somehow be viewed with a spreadsheet after being renamed.....

                      I know the check-marks don't always correspond to settings, but I noticed the events check-mark is set. I wonder if anything could be going with this field's events that is causing the problem?
                      What about the indexing etc. in the external lookup table @ G? Could there be some kind of discrepancy between the external lookup field and the field in the local table? Have you tried compacting the external table? (Anything odd with regards to indexes used in combination with possible odd field values? (see "Odd characters in fields" below)

                      In my bug discoveries, I've come across numerous instances where things don't happen as expected for seemingly totally unrelated reasons. And then it's not a "broken all the time scenario" which is maddening lol. Recently I uncovered a .dbf linking issue where a5 flagged an error only sometimes. (alltrimmed values were used to determine compatibility as opposed to actual field sizes, or something like that.)

                      Odd characters in fields: Are there any strange characters anywhere in any of the field tables? I found that some of the a5 internals (actions in the menu) failed unexpectedly & unflagged when there was an asterisk ONLY in the first character of the fields value. (a menu selection in query or find, can't remember) Since this is only on one single lookup, I'd wager it just might be a similar yet totally unrelated scenario. Some strange combination of data/code etc is wreaking havoc with that lookup? ~ Odd table data characters somehow "break" the a5 code without warning.

                      FWIW: The flagged events tab triggered this thought: I very recently found out that the onArrive browse event only works with some code due to a5's internal field placement. (Script recorder shows the onArrive executing a for i = 1 to x loop to set the cursor in the selected field. This causes things like browse left/right navigation to fail etc.......

                      The only way to navigate left/right on this event trigger (that I could find worked) was via sys_send_keys("{HOME}{RIGHT}{RIGHT}") on the onArrive event!
                      All the other code was fine, just no left/right navigation etc.

                      I had to to do this to make it respond accordingly:
                      Code:
                      '[B]onArrive browse event[/B]
                      [B][COLOR="#0000FF"]sys_send_keys("{HOME}{RIGHT}{RIGHT}")  'THIS WORKED.[/COLOR][/B][COLOR="#0000FF"][/COLOR]
                      
                      
                      'parentform:control_browse3.activate()   [COLOR="#FF0000"]'BUT NONE OF THIS BELOW WORKED/MOVED THE CURSOR.....
                      [/COLOR]
                      'ON_XBASIC_IDLE()
                      end
                      'XBASIC_WAIT_FOR_IDLE()
                      	'XBASIC_WAIT_FOR_IDLE()
                      	
                      '	dim vc_Code as C
                      '	vc_Code = <<%code%
                      '		this:Status.activate()
                      '		ui_msg_box("",this:invoice.text)
                      '		this.left()
                      '		this.left()
                      '		this.left()
                      ' 		%code%
                      ' 	ON_XBASIC_IDLE(vc_Code)
                      
                      'ui_wait_until(.t.=.f.,1)
                      'this.find(alltrim(this:invoice.text))
                      
                      'sys_send_keys("{LEFT}{LEFT}{LEFT}")
                      'sys_send_keys("{HOME}")
                      'ui_msg_box("",this:invoice.text)
                      'this:Status.activate()
                      'control_browse4.home()
                      'this.left()
                      'this.left()
                      'this.left()
                      Last edited by SNusa; 02-22-2016, 11:47 AM.
                      Robert T. ~ "I enjoy manipulating data... just not my data."
                      It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                      RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                      Comment


                        #12
                        Re: Field Rule Lookup Table

                        Tom, I'm sure you know this, but in a shadowed system Alpha cannot see outside the current folder, as in field rules.
                        In scenarios like this, instead of using a field rule, I use code to open a form to open the table that is located in a folder outside the current folder, and let the user select from there.

                        PS: if the table is in a subfolder, you can add it to the current adb, and it will work.
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                          #13
                          Re: Field Rule Lookup Table

                          Martin,

                          I don't want to seem argumentative, but we use folders outside of the database folder all the time. It took quite some time to get it right, but this is how we do it:

                          We use libraries and tables from other folders by making sure we shadow the "outside " databases FIRST, then when we include them in other databases, we allow Alpha to create subfolder references to the "outside" tables and sets, then we carefully add the tables, sets and libraries from their proper folders into the shadowed database. Once the "correct" ones are added, we remove the references to the ones created in subfolders.

                          Its a LOT of work, but it does work!

                          Once it is done one time, the appropriate folder references stick, even when we "refresh" the shadow.
                          The only thing to remember when refreshing is that "external" libraries need to be re-added to the shadow database.

                          regarding the initial issue,

                          I took the advise to change the field rules with x-basic. The only difference was that my reference is to the entire path instead of the mapped drive letter.

                          "\cosmo\a5share\bcbss\Towncode.dbf"
                          insteead of
                          "g:\bcbss\towncode.dbf"

                          When I re-checked the rules using full version, the appropriate file was there.

                          Just to clarify the problem.
                          the field rule in the full master version read
                          "\BCBSS\TOWNCODE.DBF"

                          in both version 10.5 and ver 12.

                          Tom
                          Last edited by Tom Henkel; 02-23-2016, 07:08 PM. Reason: clarification

                          Comment


                            #14
                            Re: Field Rule Lookup Table

                            wow - you are totally outside my experience!!
                            sounds like you got it working.
                            Cole Custom Programming - Terrell, Texas
                            972 524 8714
                            [email protected]

                            ____________________
                            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                            Comment


                              #15
                              Re: Field Rule Lookup Table

                              Martin,
                              I certainly believe that you are minimizing your expertise!

                              If you remember from years ago, I described our "Application". We have a main database that "calls" other databases that call other databases. In ver 5, shadowing was easy. Alpha wasn't so strict on where the tables and things were located, it just used them where they were. When we went to ver 10, the system wanted everything in the database folder or subfolders. It took quite some time to figure out how to get around it, but we figured it out.

                              regarding the workaround, I'm not sure! The employee that uses the table with the lookup field rulesaid that she was good, but yesterday, she said it was still an issue, so now I'm confused all over again...

                              Tom

                              Comment

                              Working...
                              X