I need to pass the primary key (ID) for each checked row to my xbasic function (This checkbox is alpha generated from the grid properties Has Checkbox Select Column). Then loop through them to perform some SQL updates. Below is what I have thus far. The tooltips for an ajax callback don't say how to do this. {grid.RowNumber} apparently is only for the selected row. How do I pass all of the checked rows?? I'm thinking there needs to be some JS that precedes the ajax callback but I don't know what that would be....also, how do I write the argument for this? I don't think args.set("arg2",val(e._currentRowDataNew.ID)) would be correct.
Thank you.
Button that runs ajax callback...
xbasic function...
Thank you.
Button that runs ajax callback...
Code:
{grid.Object}.ajaxCallback('G',{grid.RowNumber},'Autosign','','');
Code:
'The below script auto signs form function AutoSign as c (e as p) 'check to see if any rows are checked. If none warn user. dim count as n count = val(e.checkboxRows.countChecked) if count = 0 then AutoSign = "alert('You didn't check any rows.');" exit function end if 'we have checked rows so continue. dim cn as sql::connection cn.Open("::Name::SQL") 'saved connection string dim args as sql::arguments dim rs as sql::ResultSet dim result as l dim i as n for i = 1 to count args.set("arg1",(session.__protected__fullname)) args.set("arg2",val(e._currentRowDataNew.ID)) args.set("arg3",now()) cn.Execute("UPDATE Physician_Certification_Form SET Physician_Certification_Form.HospicePhysSignature = (SELECT contact.Staff_Signature) FROM contact WHERE contact.CombinedName=:arg1 AND Physician_Certification_Form.ID = :arg2",args) cn.Execute("UPDATE Physician_Certification_Form SET HospicePhySig_Time = :arg3 WHERE Physician_Certification_Form.ID = :arg2",args) next i cn.FreeResult() cn.close() AutoSign = "{grid.Object}.refresh();alert('The forms has been signed.');" end function
Comment