Hi All
I have a grid component which has been running fine in v10.5 and v11, I now have v12 and my component runs but I seem to get a "mixed bag" of results from a drop down control on the component. As mentioned this all worked fine prior to v12..
My app is multi tenated so I am querying my "main" database to fetch back a list of available options that pertain to the current logged in user.., On my grid initialise I have the following a5 code
'session.cu = a5ws_getcurrentuser()
dim cu as c
session.cu = e.rv.session.emailaddress
'Open main SQL DB and retreive branch key and agency id for branch selection screen
dim cn as sql::connection
connection = "::name::TravelcloudSQL"
if cn.open(connection)
dim args as sql::Arguments
dim rs as sql::ResultSet
dim dbsn as c
dim dbcs as c
dim ssun as c
dim sspass as c
dim sqluser as c = "select branch_key, agency_id from users where emailaddress = :currentuser"
args.add("currentuser",session.cu)
if cn.Execute(sqluser,args)
rs = cn.ResultSet
if rs.nextrow()
session.branchkey = rs.data("branch_key")
session.agency_id = rs.data("agency_id")
end if
end if
This basically sets a session variable called branchkey which I then use in a query on my dropdown box on the component
SELECT DISTINCT Agency_Name FROM Agencies where agencies.branch_key = session.branchkey ORDER BY Agency_Name
The problem I am having is that sometimes the results in the dropdown box are correct and relate to the current user, other times they are incorrect and don't bear any relation to the user that has logged in, I have added a button on my component which shows the value of both variables above and they are always correct..
I am pretty sure it is to do with my session.branchkey but I am struggling to find out what
Any help greatly appreciated
thanks
john
I have a grid component which has been running fine in v10.5 and v11, I now have v12 and my component runs but I seem to get a "mixed bag" of results from a drop down control on the component. As mentioned this all worked fine prior to v12..
My app is multi tenated so I am querying my "main" database to fetch back a list of available options that pertain to the current logged in user.., On my grid initialise I have the following a5 code
'session.cu = a5ws_getcurrentuser()
dim cu as c
session.cu = e.rv.session.emailaddress
'Open main SQL DB and retreive branch key and agency id for branch selection screen
dim cn as sql::connection
connection = "::name::TravelcloudSQL"
if cn.open(connection)
dim args as sql::Arguments
dim rs as sql::ResultSet
dim dbsn as c
dim dbcs as c
dim ssun as c
dim sspass as c
dim sqluser as c = "select branch_key, agency_id from users where emailaddress = :currentuser"
args.add("currentuser",session.cu)
if cn.Execute(sqluser,args)
rs = cn.ResultSet
if rs.nextrow()
session.branchkey = rs.data("branch_key")
session.agency_id = rs.data("agency_id")
end if
end if
This basically sets a session variable called branchkey which I then use in a query on my dropdown box on the component
SELECT DISTINCT Agency_Name FROM Agencies where agencies.branch_key = session.branchkey ORDER BY Agency_Name
The problem I am having is that sometimes the results in the dropdown box are correct and relate to the current user, other times they are incorrect and don't bear any relation to the user that has logged in, I have added a button on my component which shows the value of both variables above and they are always correct..
I am pretty sure it is to do with my session.branchkey but I am struggling to find out what
Any help greatly appreciated
thanks
john
Comment