Alpha Video Training
Results 1 to 14 of 14

Thread: Grid Filter Issue

  1. #1
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Grid Filter Issue

    Hi All,

    I have a little problem that is driving me mad.

    I have a Grid with that has an Argument Called User which is a Session Variable. I use that Argument in a Filter for a Grade which looks like email_address = :User

    The issue that I am having is thefirst time the User Logs in the Filter doesn't work and they get the No Records in Query Message. They then logout and back in and they get the data they should get.

    Any Help gratefully received.

    Thanks

    Chris

  2. #2
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,530

    Default Re: Grid Filter Issue

    Hi Chris

    Sounds like the session variable for some reason is not created on first login. How do you set the session variables in the first instance?

    One thing to do to test would be to set up an a5w page that you can load some xbasic

    a5w_info()

    That page will show you all available variables as well as a bunch of other info.

    Cheers
    Glen Schild



    My Blog


  3. #3
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Hi Glen,

    Thanks for the reply.

    The UserID is setup in an a5w page called login_processing after a User Logs in.

    See below

    <%A5

    ' dim variables

    dim session.current_username as c
    dim session.UserID as c

    ' get user
    'cn = "::name::RSPortal"
    'table = "rsp_registered_users"
    'filter = "username = '" + a5ws_getcurrentuser() + "'"
    'result = "email_address"

    'session.current_username = sql_lookup(cn,table,filter,result)

    'session.UserID = result

    session.UserID = a5ws_getcurrentuser() + "@webaddress.net"

    'redirect user to launcher
    response.redirect("rsp_portal_tabbedUI.a5w")

    %>

    Chris

  4. #4
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    It seems that nothing to do with the session is set first time in.

    What would caus this.

    Chris

  5. #5
    "Certified" Alphaholic Charles Hoens's Avatar
    Real Name
    Charles Hoens
    Join Date
    Sep 2000
    Location
    Princeton, NJ
    Posts
    1,171

    Default Re: Grid Filter Issue

    I'll take a quick stab at this, as no one else is answering. I think the problem is in setting up your session.UserID.

    What I do is this...

    Code:
    a5ws_logged_in_user_values(pUser,request,session) 
    
    if eval_valid("pUser.userid") = .T. then 
    session.vusername = alltrim(pUser.userID)
    end if
    I believe that this is the "preferred" method. After capture of the userid you can then set your username up like I have done i.e. by setting a session variable. So you might go with:

    session.vuserid = alltrim(pUser.userID)+"@webaddress.net"


    Also, avoid using Userid as the seesion variable name. Just to keep things straight I always preface session variables with a "v". Keeps me out of trouble.

    Hope this helps.

    Charlie

  6. #6
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Hi Cahrlie

    Thanks for the reply.

    I am a little confused as to how I should setup the above and what variables I need to declar. Also what is the session.vusername doing. Sorry to be a plonker.

    Chris

  7. #7
    "Certified" Alphaholic Charles Hoens's Avatar
    Real Name
    Charles Hoens
    Join Date
    Sep 2000
    Location
    Princeton, NJ
    Posts
    1,171

    Default Re: Grid Filter Issue

    Don't know what a "ploker" is, but I may be one too.

    In place of the code you showed, insert the following:

    Code:
    dim session.vuserid as c=""
    a5ws_logged_in_user_values(pUser,request,session) 
    
    if eval_valid("pUser.userid") = .T. then 
    session.vuserid = alltrim(pUser.userID)+"@webaddress.net"
    end if
    
    
    response.redirect("rsp_portal_tabbedUI.a5w")
    DO NOT use userid as a variable as that is a reserved word for security. Use the vuserid variable on the page you are redirecting to.

    That should do it.

    Good luck,

    Charlie

  8. #8
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Error:Script:" /rspnm/login_processing.a5w" line:21
    a5ws_logged_in_user_values(pUser,request,session)
    Variable "pUser" not found.

    Charlie I get this message which of the above variables need declaring and are they character or numeric. Does it make any difference that I am using SQL.

    cHRIS

  9. #9
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Charlie

    I have found that I need dim pUser as p

    I have done that but unfortuantely I still have the same issue.

    CHRIS

  10. #10
    "Certified" Alphaholic Charles Hoens's Avatar
    Real Name
    Charles Hoens
    Join Date
    Sep 2000
    Location
    Princeton, NJ
    Posts
    1,171

    Default Re: Grid Filter Issue

    Sorry yes, you need to dim that variable. But if you did so, what is the message you are gettng now?

    It does not matter that you are using SQL. You are dealing with the security settings.

    Have you set security up and defined your login user?


    Charlie

  11. #11
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Charlie

    I am still getting the same original issue where first time in No Records are selected logout and back in there they are.


    I have had a look at the a5w_info and no variables are set first time in - secongd time they appear.


    Chris

  12. #12
    "Certified" Alphaholic Charles Hoens's Avatar
    Real Name
    Charles Hoens
    Join Date
    Sep 2000
    Location
    Princeton, NJ
    Posts
    1,171

    Default Re: Grid Filter Issue

    OK. So this means that you are getting by the session setup.

    On the filter for your page try email_address = session.vuserid

    Other than that I'm out of guesses.

    Charlie

  13. #13
    Member
    Real Name
    Chris Turnbull
    Join Date
    Oct 2009
    Posts
    445

    Default Re: Grid Filter Issue

    Charlie

    That just gave me an error message.

    Thanks very for helping me tonight.

    I will let you know when I solve it.

    Thanks

    Chris
    Chris

  14. #14
    "Certified" Alphaholic Charles Hoens's Avatar
    Real Name
    Charles Hoens
    Join Date
    Sep 2000
    Location
    Princeton, NJ
    Posts
    1,171

    Default Re: Grid Filter Issue

    Well, it might be best if you published an example. I am sure that many more people will weigh in on what can/cannot be done.

    Charlie

Similar Threads

  1. Filter issue on Grid
    By envisionsolutions in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 10-26-2010, 01:39 PM
  2. filter issue
    By klamee in forum Alpha Five Version 10 - Desktop Applications
    Replies: 5
    Last Post: 02-19-2010, 06:42 PM
  3. Filter issue
    By DVSOL005 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 12
    Last Post: 11-18-2009, 12:36 PM
  4. Filter Issue - Not working
    By Rachel Siegel in forum QReportBuilder
    Replies: 2
    Last Post: 02-04-2008, 03:40 PM
  5. Report Filter Issue
    By spain246 in forum Alpha Five Version 6
    Replies: 2
    Last Post: 08-05-2005, 10:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •