I must be missing something real simple here because my callback isn't firing. This is in a grid/detail view. Here's the code...
onGridRenderComplete client-side event ...this appears to be working. I get my alert message as expected.
Xbasic function ...my very first alert never fires.
onGridRenderComplete client-side event ...this appears to be working. I get my alert message as expected.
Code:
var po = {grid.Object}.getParentObject(); var who = po._ParentName; if (who=='Single'){ {grid.Object}.detailView(1) } else{ {grid.Object}.detailViewNewRecord(); alert('callback about to fire'); {grid.Object}.ajaxCallback('D',1,'AutoPopulate','','',{}); return; }
Code:
'This populates staffname and staff specialty automatically based upon fullname session variable function AutoPopulate as c (e as p) debug(1) AutoPopulate="alert('xbasic function firing');" dim cn as sql::connection dim args as sql::arguments dim staffname as c dim specialty as c args.set("staff",(session.__protected__fullname)) cn.Open("::Name::SQL") 'saved connection string cn.Execute("SELECT CombinedName, StaffSpecialty FROM Contact WHERE CombinedName = :staff", args) save_to_file(cn.callresult.text, "c:\users\dad\desktop\auto.txt") staffname = cn.ResultSet.data("CombinedName") specialty = cn.ResultSet.data("StaffSpecialty") AutoPopulate="alert('staff ' + staffname + 'specialty ' + specialty);" AutoPopulate="{grid.object}.setValue('D', 'StaffName', staffname ); {grid.object}.setValue('D', 'StaffSpecialty', specialty);" cn.FreeResult() cn.close() end function
Comment