Hi-
I'm moving along with my first A5 app, following Steve Workings videos on log-in and session variables. So I have it working, the user logs in and I have a top where the company name and user fullname is displayed as well as a log out link. So all this works and I'm off to start on the first filtered component but come back to test it by logging and now it will not "see" my session variables and produces an error. My intermediate process code is below.
<%a5
dim session.CompanyID as N=0 'set to zero so there cannot be a company primary key with this value.
dim session.SubCompanyID as N=0 'also set to zero
dim session.IsLogixLink as L=.f. 'if the user is from LogixLink, show all data.
dim session.IsLicenseOwner as L=.f. 'if the user does not own the software, make sure they only see their data
dim session.CompanyName as C="" 'to display the company name.
dim session.FullName as C="" 'to display the user's name.
dim session.User as C=""
'Get the Company ID of the current user.
dim GetCurrentUser as C
GetCurrentUser=a5ws_getcurrentuser()
if GetCurrentUser<>"" 'This should never happen at this point.
session.user=a5ws_getcurrentuser()
dim args as sql::Arguments
args.Set("Username",GetCurrentUser)
'Get the Company ID for use throughout program to display proper inventory.
session.CompanyID=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","LicenseOwners_PK",args)
'Get the name of the company for display purposes.
session.CompanyName=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","CompanyName",args)
'Get the full name of the user for display purposes.
session.FullName=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","FullName",args)
end if
response.redirect("Index.a5w")
%>
The code in my "page top" looks like this:
<%a5
If a5ws_getcurrentuser() <> ""
?"Company Name: "+session.CompanyName+" User: "+session.FullName+" <a href=\"Logout.a5w\">(Logout)</a>"
end if
%>
The error that shows up if I hit the "back" button on the browser is:
Script Error
Error:Script:PageTop.a5w line:44
?"Company name is :"+session.CompanyName+"<a href=\"Logout.a5w\">(Logout)</a>"
Property not found
session.CompanyName subelement not found
This is on my developement laptop obviously. Any ideas where I start to track this down. As I said, it worked and I don't think I did anything else to make it stop working. I moved on to creating a simple grid based on a session id. That did not work and that made me go back and look at the log in.
Thanks
I'm moving along with my first A5 app, following Steve Workings videos on log-in and session variables. So I have it working, the user logs in and I have a top where the company name and user fullname is displayed as well as a log out link. So all this works and I'm off to start on the first filtered component but come back to test it by logging and now it will not "see" my session variables and produces an error. My intermediate process code is below.
<%a5
dim session.CompanyID as N=0 'set to zero so there cannot be a company primary key with this value.
dim session.SubCompanyID as N=0 'also set to zero
dim session.IsLogixLink as L=.f. 'if the user is from LogixLink, show all data.
dim session.IsLicenseOwner as L=.f. 'if the user does not own the software, make sure they only see their data
dim session.CompanyName as C="" 'to display the company name.
dim session.FullName as C="" 'to display the user's name.
dim session.User as C=""
'Get the Company ID of the current user.
dim GetCurrentUser as C
GetCurrentUser=a5ws_getcurrentuser()
if GetCurrentUser<>"" 'This should never happen at this point.
session.user=a5ws_getcurrentuser()
dim args as sql::Arguments
args.Set("Username",GetCurrentUser)
'Get the Company ID for use throughout program to display proper inventory.
session.CompanyID=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","LicenseOwners_PK",args)
'Get the name of the company for display purposes.
session.CompanyName=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","CompanyName",args)
'Get the full name of the user for display purposes.
session.FullName=sql_lookup("::name::LogixDBLink","LicenseOwners","UserName=:UserName","FullName",args)
end if
response.redirect("Index.a5w")
%>
The code in my "page top" looks like this:
<%a5
If a5ws_getcurrentuser() <> ""
?"Company Name: "+session.CompanyName+" User: "+session.FullName+" <a href=\"Logout.a5w\">(Logout)</a>"
end if
%>
The error that shows up if I hit the "back" button on the browser is:
Script Error
Error:Script:PageTop.a5w line:44
?"Company name is :"+session.CompanyName+"<a href=\"Logout.a5w\">(Logout)</a>"
Property not found
session.CompanyName subelement not found
This is on my developement laptop obviously. Any ideas where I start to track this down. As I said, it worked and I don't think I did anything else to make it stop working. I moved on to creating a simple grid based on a session id. That did not work and that made me go back and look at the log in.
Thanks
Comment