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

Verifying a field rule exist.

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

    Verifying a field rule exist.

    I have looked at all the field rule functions I could find in the docs and none seem to be able to return the info I need to look for.

    Basically I need to check a table and see if a field rule exist in the Events/Record Events/CanEnterRecord

    I know this can be done, just have not figured out how.

    #2
    Re: Verifying a field rule exist.

    http://www.wiki.alphasoftware.com/~a...LES_GET+Method
    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


      #3
      Re: Verifying a field rule exist.

      Tried that already. Does not work.

      Comment


        #4
        Re: Verifying a field rule exist.

        Getting closer but still no cigar. This returns the event rules for the field but not the record event rules.

        Code:
        dim tbl as P
        dim fld as P
        dim rules as P
        tbl = table.open("wo_header.dbf")
        fld = tbl.field_get("INV_ID")
        rules = fld.rules_get()
        ?rules.Code
        = CanEditField = ""
        CanWriteField = ""
        OnEditField = ""
        OnWroteField = ""

        Comment


          #5
          Re: Verifying a field rule exist.

          Not seeing a method to get it. Must be one somewhere - other then A5DOC....

          Copied the structure files to a table(ddd->dbf, ddm->fpt, ddx_>cdx) and found that there is a type DRUL with the code in it.

          datadict.png
          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


            #6
            Re: Verifying a field rule exist.

            Got it.

            Code:
            dim tbl as P
            dim tbr as P
            tbl = table.open("vendor.dbf")
            tbr = tbl.rules_get()
            ?tbr.Code
            = CanChangeRecord = ""
            CanDeleteRecord = ""
            CanEnterRecord = 'Date Created: 01-Dec-2015 05:43:09 PM
            'Last Updated: 01-Dec-2015 05:43:09 PM
            'Created By  : ShopCal
            'Updated By  : ShopCal
            if user_level > 8 'just something to test this.
            	
            	end if
            	
            CanMarkRecord = ""
            CanSaveRecord = ""
            CanUnmarkRecord = ""
            OnChangeRecord = ""
            OnDeleteRecord = ""
            OnEnterRecord = ""
            OnMarkRecord = ""
            OnSaveRecord = ""
            OnUnmarkRecord = ""
            Also just found that if you "dot" the event name after the ".code" it will return only the code for that event.
            So tbr.Code.CanEnterRecord will return only the results for the CanEnterRecord event.

            Cool...
            Last edited by preston2; 12-01-2015, 08:02 PM. Reason: Found out more stuff.

            Comment


              #7
              Re: Verifying a field rule exist.

              And if it doesn't exist you can add it with a variation of that code.
              There can be only one.

              Comment


                #8
                Re: Verifying a field rule exist.

                Originally posted by Stan Mathews View Post
                And if it doesn't exist you can add it with a variation of that code.
                That is the whole idea Stan.

                I am going to have a table rule that is logical. Depending on the .T. or .F. result it will allow or disallow the user to be able create a new record or modify an existing.

                As I know, some out there may get the big idea to remove that table rule to get around it so I will use the code above with a few more modifications in a function that will check to see if the table rule is still in place and if not, give them a big warning on the way to shutting the app down. Or I could just have the function add the rule back.

                A least that is the idea anyway..

                Comment


                  #9
                  Re: Verifying a field rule exist.

                  So, the idea here is if a user went and changed the field rules to be able to enter or change a record, you will, via your function (or script), prevent him from doing so?
                  Doesn't it stand to reason that if a user could go and change the field rules that he/she could also go and change or delete your function?
                  Doesn't it make more sense to deny the user any access to the Control Panel altogether?
                  What's missing from this story?

                  Comment


                    #10
                    Re: Verifying a field rule exist.

                    Originally posted by G Gabriel View Post
                    So, the idea here is if a user went and changed the field rules to be able to enter or change a record, you will, via your function (or script), prevent him from doing so?
                    Doesn't it stand to reason that if a user could go and change the field rules that he/she could also go and change or delete your function?
                    Doesn't it make more sense to deny the user any access to the Control Panel altogether?
                    What's missing from this story?
                    No, they cannot delete the function. The function will be in a separate .aex file that is "Loaded" in the autoexec. Then on top of that all the scripts and functions for the app will be compiled into an .aex and then the code will be removed from the "code" tab.

                    Now it they want to try and create their own scripts and then delete the .aex files, more power to them but it will take them about two years to figure enough of the code out to recreate in order to get the app to even work right.

                    Denying the user access to the control panel does not really work if they have the developer. Even if you turn debug off so they cannot use ctrl-shift to get into the control panel, they can still get in because the debug off does not stick from one Alpha developer program to the next. I know as I have tried it.

                    Comment


                      #11
                      Re: Verifying a field rule exist.

                      So, the part was missing from the story is that they have the developer and you are trying to protect your own developed version from tampering.

                      Comment


                        #12
                        Re: Verifying a field rule exist.

                        Originally posted by G Gabriel View Post
                        So, the part was missing from the story is that they have the developer and you are trying to protect your own developed version from tampering.
                        Basically correct G.

                        Most will use my apps as intended and only have the run time but because it is impossible to hide the fact that the app was developed with Alpha, some get the big idea of downloading a trial of Alpha to see if they can get around my registration system and thus continue to use the app for free.

                        As time goes on, I figure out more ways to close any holes that they may try and get through. I even have some scripts and functions that allow me to shut their app down over the internet. I came up with this because I had one person buy an app, got their registration number and then told their CC company they did not make the purchase. So I created what I call a jipsters function and slipped it in via a series of updates. After it had been in the app for about 3 updates, I shut his copy down and he paid me the next day.

                        You have to out think people who will try and scam you to save a few bucks. Besides, I love learning all this stuff anyway.

                        Comment


                          #13
                          Re: Verifying a field rule exist.

                          Have you tried, instead of field rules, to code the objects on the forms and password protect your forms?
                          Also, I am assuming you are encrypting your scripts.

                          Comment


                            #14
                            Re: Verifying a field rule exist.

                            I am going to have a table rule that is logical. Depending on the .T. or .F. result it will allow or disallow the user to be able create a new record or modify an existing.
                            I asked myself a question years ago - "Mike, how can you hold data in a password protected environment in an application and have that data accessed and change dynamically through a script other than having data residing in an object or a table field?" The answer for me .... inside a script.

                            I use a script I name 'mms_registration_vault' that holds pieces of data for registration. Scripts are password protected and accessible through two other scripts using script_load() and script_save(). The contents of the vault script is something like this:
                            Code:
                            'password myimpossibletoguesspassword
                            
                            <<%r%
                            $@$delineator$@$
                            verification_string===mikewilsoncompanyverificationstringa1b2c3d4e5!@#
                            $@$delineator$@$
                            registration_code===721p-d263-2030-rh07-54375422
                            $@$delineator$@$
                            %r%
                            The assumptions are that very few people have the capacity to break into a password protected script. They can try and delete it and rebuild it, but that is where the contents/construct of the script can be proprietary and the likelihood of a correct re-construct is infinitesimal. But I add a verification string as a first check of the contents to assure the vault is valid.

                            I have one script that handles collecting the registration data and writing to the vault script and one that checks the vault contents for validity and up-to-date registration. I have a navigation system in my apps, so I place a call to the registration checking script when certain critical forms are accessed. It has worked to be very robust, fast and easy. I don't worry about not letting someone have write capabilities to tables if registration is void/invalid/lapsed. I just don't let them in or I close the app if a valid registration isn't entered.

                            And just to have is said...I avoid using field rules as much as I possibly can.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #15
                              Re: Verifying a field rule exist.

                              Originally posted by G Gabriel View Post
                              Have you tried, instead of field rules, to code the objects on the forms and password protect your forms?
                              Also, I am assuming you are encrypting your scripts.
                              Not sure if password protecting forms will hold if you are not using the Alpha built in security. I am moving away from that because any users that get setup are wiped out when an update is applied to the app and the end user must remember to backup users first and then restore after every update.

                              Also coding the object on a form means you have to do that on every form and every object on the form you are trying to stop them from doing any data entry once their trial expires. By placing the one table event rule you can shut down modification of any data used in a table app wide. So one spot and you have it covered. Then just check on start up and make sure the rule was not removed.

                              Comment

                              Working...
                              X