Hi Everyone,
The function below works great the first time it's executed,
but if it's executed more than once it throws the error shown in
the image below.
Is there a way to reset the state variable without having the user
refresh the page ?
Any help will be greatly appreciated.
Gregg
2023-03-23_15-40-29.png
The function below works great the first time it's executed,
but if it's executed more than once it throws the error shown in
the image below.
Is there a way to reset the state variable without having the user
refresh the page ?
Any help will be greatly appreciated.
Gregg
2023-03-23_15-40-29.png
Code:
function loadStagging as C (e as P) dim err as p dim currentScript as p currentScript.name = "loadStagging" currentScript.type = "UDF" currentScript.parameters = "e as P" dim ls as p dim ls.CN as sql::connection dim ls.RS as sql::resultSet dim ls.ARGS as sql::arguments dim sqlCode as p dim itsOpen as L dim itWorked as L dim response as C dim js as C on error goto lswtf sqlCode.loadStagging = <<%txt% select dl.label, dl.bol, dl.logged, dl.location, dl.asnmatch, dl.rowmatched, dl.distressed, dl.reporteddistressed, dl.seq FROM evh05warehousing.fedexinboundlog dl where gl.mydformat(dl.logged) >= NOW()-interval 1 month %txt% js = <<%txt% debugger; var sourceData = JSON.parse({dialog.object}.stateInfo['workingStagging']); {dialog.object}.stateInfo['workingStagging'] = sourceData; sourceData = ''; initializeVB('fedexInboundLogVB','workingStagging') //debugger; %txt% debug(1) itsOpen = ls.CN.Open("::name::connection1") ls.CN.PortableSQLEnabled = .f. if itsOpen then if eval_valid("e._state.workingStagging") then e._state.workingStagging = "" end if e._state.workingStagging = ls.CN.ToJSON(sqlCode.loadStagging) response = js else response = "alert('Error accessing Server!');" end if if ls.CN.IsOpen then ls.CN.Close() end if return response exit function 'loadStagging lswtf: texttospeech("fudge") err = currentScript err.line = "at line "+convert_type(error_line_number_get(),"C") err.msg = "Error in "+currentScript.name+crlf()+error_text_get(error_code_get() ) debug(1) end function 'loadStaggin
Comment