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

use security log in as variable throughout

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

    use security log in as variable throughout

    Is it possible to obtain the user name from the users log in (using a5 security) and then use this through out the programme, for example on the welcome screen a message saying "welcome Richard" (richard being the user)

    i wish to use this facility to auto set values of some fields, for example;

    when a note is added to a case file for a client, i want alpha to auto recognise the user adding the note (through scurity log in) and fill the field in for me with the users name. i have many other uses for this facility.

    i was able to create this facility in access but didnt use access's security and created my own instead (i found access's way too complicated, whereas a5 seems much simpler)

    any ideas appreciated.

    thanks again

    richard

    #2
    Re: use security log in as variable throughout

    Originally posted by richard2007 View Post
    Is it possible to obtain the user name from the users log in (using a5 security)
    Oddly enough, the user name of the currently logged in user is available with the function

    USER_NAME()

    If the user is logged in as "Richard Milhouse Nixon" ....

    word(USER_NAME(),1)

    would yield "Richard"
    Last edited by Stan Mathews; 10-30-2007, 04:15 PM.
    There can be only one.

    Comment


      #3
      Re: use security log in as variable throughout

      perfect

      Thanks Stan,

      Comment


        #4
        Re: use security log in as variable throughout

        Hi Stan,

        i have tried this and itr works great, however after the initial log in the variable is retaining the users name and changing the variable to

        user="Richard" instead of
        user =word(USER_NAME(),1)

        so when the next user logs on the variable shows the last users name.

        i amigine i would need to set code to remove the user maybe in an exit alpha command, but not too sure if this is correct and if so how to do it.

        any ideas

        thanks

        richard

        Comment


          #5
          Re: use security log in as variable throughout

          Where are you assiging the variable? I believe that the autoexec fires after the login, although if you allow users to login w/o exiting Alpha that might not be the place to put it.
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: use security log in as variable throughout

            Why would you assign the user name to a variable at all? It is always available and current as

            user_name()
            There can be only one.

            Comment


              #7
              Re: use security log in as variable throughout

              i was assinging a global variable as i could see no other way of creating a welcome message.

              i did try to create an unbound text box, but cant seem to get this to accept user_name()

              i did try shutting alpha down and re starting but the assigned variable had already changed.

              any ideas on how to achieve my welcome message - i have checked the help files.

              thanks
              richard

              Comment


                #8
                Re: use security log in as variable throughout

                Hi Richard,

                Try using an rtf object on your form. That will allow you to insert an expression which would be the one that Stan provided to you earlier in this thread.

                Good luck
                Cheryl
                #1 Designs By Pagecrazy
                http://pagecrazy.com/

                Comment


                  #9
                  Re: use security log in as variable throughout

                  thanks cheryl,

                  i think i tried every other control that i thought would be able to do this. ill give this a go.

                  regards

                  Richard

                  Comment


                    #10
                    Re: use security log in as variable throughout

                    right, im back on to this subject.

                    i am slightly diversifying from my original plan, as i now feel if i filter the start up form based upon the logged on user, this will be a better way to achieve what i want.

                    so far, i have a form called 'switchboard', based upon a set within which is a field called 'employeename'

                    i have set the filter of the form to 'employeename = user_name()' but i am getting no entry in the field employeename.

                    the form does have browses which have records specific to the logged on user (hence my thinking in setting a form filter).

                    i now understand what stan was explaining above and have used this in other parts of my programme, but would appreciate some guidance on this.

                    thanks

                    richard

                    Comment


                      #11
                      Re: use security log in as variable throughout

                      Richard,
                      I think it is the syntax of your filter expression. What is returned when you go into the interactive editor and type:

                      Code:
                      ? a5_get_records_in_query("yourtablename","employeename = username()")
                      I'll bet you get =0

                      And if you try this?

                      Code:
                      dim vEM as c
                      vEM = username()
                      ? a5_get_records_in_query("yourtablename","employeename = "+s_quote(vEM))
                      I'll bet you get =1.

                      Then try this and see what happens.
                      Code:
                      ? a5_get_records_in_query("yourtablename","employeename = "+s_quote(user_name))
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: use security log in as variable throughout

                        mike, thansk for the quick reply.

                        i returned a value of 2 on your last suggestions. was that correct?

                        i have moved on a step further but not sure if i am correct.

                        i had created a calculated field 'c_user' with an expression 'user_name()'. then i have applied a filter to the form 'employeename=user_name()'

                        this has worked so far in that the calculated field is picking up the ogged user but the form is not.

                        i have thought about introducing an in between form, which would load with the calculated field and then a command to open the 'switchboard' using the calc field c_user as the filter.

                        good or bad idea?

                        thanks

                        Comment


                          #13
                          Re: use security log in as variable throughout

                          Richard,
                          I think you are getting too indirect and complicated about it.

                          Start by manually using the Genie on the form with a Query to the expression user_name() and see what happens. Do you get 2 returns?
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: use security log in as variable throughout

                            im not sure what i am doing, but i get no returns when i try to search employeename = user_name() using the form query genie.

                            Comment


                              #15
                              Re: use security log in as variable throughout

                              what happens in the interactive window when you type: ? user_name()
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X