I hope someone can help. I couldn't find a solution in documentation or on the Message Board.
I have a button on a UX that runs the "SetConstructionNum" XBASIC function, below. My goal is use the "result set" (from a table has only 1 field and only 1 row... The table is used to hold a single value) to populate a single field on the UX component. The code runs perfectly, without any errors, but doesn't populate the UX field. What did I do wrong?
NOTES:
Phil
_____________________________________________________________________
I have a button on a UX that runs the "SetConstructionNum" XBASIC function, below. My goal is use the "result set" (from a table has only 1 field and only 1 row... The table is used to hold a single value) to populate a single field on the UX component. The code runs perfectly, without any errors, but doesn't populate the UX field. What did I do wrong?
NOTES:
- When I use the debugger, the variable "ConstructionNum" DOES get the correct value I'm looking for;
- The UX field I'm trying to populate is "ConstructNumHolder"
- The "js = " line doesn't populate the field. I think I'm doing something wrong to run the javascript function
Phil
_____________________________________________________________________
function SetConstructionNum as c (e as p)
'debug(1)
DIM cn AS sql::Connection
DIM rs AS sql::ResultSet
DIM sqlCommand AS c = ""
Dim ConstructionNum as c
Dim js AS c
flag = cn.Open("::name::SQL_Database")
sqlCommand = "SELECT Expr1 FROM dbo.SetContructionNumber"
flag = cn.Execute(sqlCommand)
rs = cn.ResultSet
ConstructionNum = Str(rs.data(1) + 1) 'This variable DOES contain the value I'm looking for
js = "{dialog.object}.setValue('CONSTRUCTNUMHOLDER',ConstructionNum};"
SetConstructionNum = js 'I'm afraid this is isn't the right command to run the setvalue javascript line
end function
'debug(1)
DIM cn AS sql::Connection
DIM rs AS sql::ResultSet
DIM sqlCommand AS c = ""
Dim ConstructionNum as c
Dim js AS c
flag = cn.Open("::name::SQL_Database")
sqlCommand = "SELECT Expr1 FROM dbo.SetContructionNumber"
flag = cn.Execute(sqlCommand)
rs = cn.ResultSet
ConstructionNum = Str(rs.data(1) + 1) 'This variable DOES contain the value I'm looking for
js = "{dialog.object}.setValue('CONSTRUCTNUMHOLDER',ConstructionNum};"
SetConstructionNum = js 'I'm afraid this is isn't the right command to run the setvalue javascript line
end function
Comment