I have an xbasic function that I am trying to pass an argument to via an ajax callback.
Basically, I just want one button to determine which function to call from the switchboard.
Sounds simple but I keep getting the error:
The function:
The Callback:
Is there a better way to do this?
Basically, I just want one button to determine which function to call from the switchboard.
Sounds simple but I keep getting the error:
Error executing Ajax callback function 'switchboard' Error reported was: Variable is of different type
Code:
function switchboard as c (circuit as c, e as p) DEBUG(1) dim global cn as SQL::Connection dim global rs as SQL::ResultSet dim global args as SQL::Arguments dim global sqlStatement as c dim global clientid as n = convert_type(e._currentRowDataNew.APPLICANTID,"n") dim global itemcode as n = convert_type(e._currentRowDataNew.ITEM_CODE,"n") dim global arr_data[0] as p dim global content as c dim global reportHtml as c dim global x as n = 0 dim global fldr as c = "C:\a5v11\A5Webroot\reports" dim global vfile as c = remspecial(api_uuidcreate()) + ".htm" dim global path as c = fldr + "\\" + vfile dim global js as c = "redirectUrl('http://ablejobs.us/reports/"+vfile+"');" dim menu as c = circuit cn.open("::name::adam") select case menu = "criminal" CriminalReport(e) case menu = "screened" ScreenedWorkHistory(e) case menu = "unscreened" UnscreenedWorkHistory(e) case menu = "resume" makeResume(e) case menu = "archive" set_archive_on(e) case menu = "delete" deleteRecord(e) end select cn.close() end function
Code:
var rowNum = {Grid.RowNumber}; var id = {grid.Object}.getValue('G','ITEM_CODE',rowNum); var numID = Number(id); if(numID > 299) { {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','switchboard','','_getData=true&'+'circuit=criminal',{}); } else if (numID == 150) { {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','switchboard','','_getData=true&'+'circuit=screened',{}); } else if (numID == 140) { {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','switchboard','','_getData=true&'+'circuit=unscreened',{}); } else if (numID == 125) { {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','switchboard','','_getData=true&'+'circuit=resume',{}); }
Comment