my dialogs repeating section collects a 3 year address history for our clients, there may be 1 or 2 clients address history collected.
fields in the section inc; client (first or second), yrs and mths. i have a field in the table 'Address_tot' which calculates '(yrs*12)+mths'
i need to total the months for each client, this is what i have so far, which works in doing the calculation but i have an issue with what maybe an ajax callback, but im only just starting out with this ajax. The issue is in setting the value in the table change function. i have to refresh the page and then resubmit the data to get a correct value.
in the serverside 'dialogValidate' event
in the serverside 'afterDialogValidate' event
i hope this makes sense, if not please let me know and ill try to explain it differently. i need this validation in a few areas of my app so will be really useful to be able to get it working.
fields in the section inc; client (first or second), yrs and mths. i have a field in the table 'Address_tot' which calculates '(yrs*12)+mths'
i need to total the months for each client, this is what i have so far, which works in doing the calculation but i have an issue with what maybe an ajax callback, but im only just starting out with this ajax. The issue is in setting the value in the table change function. i have to refresh the page and then resubmit the data to get a correct value.
in the serverside 'dialogValidate' event
Code:
dim session.resmths1 as n dim session.resmths2 as n session.resmths1 = tablesum("tclientres","caseref ="+quote(session.caseref)+" .and. client='First'","address_tot") session.resmths2 = tablesum("tclientres","caseref ="+quote(session.caseref)+" .and. client='Second'","address_tot")
Code:
dim tbl as p dim session.caseref as c dim ndx as p dim session.resmths1 as n dim session.resmths2 as n tbl=table.open("[pathalias.adb_path]\progress.dbf") query.filter="caseref="+quote(session.caseref) query.order="" query.options="" ndx=tbl.query_create() tbl.change_begin() if session.resmths1 > 35 then tbl.comp_res1 = "Completed" else tbl.comp_res1 = "Not Completed" end if if session.resmths2 > 35 then tbl.comp_res2 = "Completed" else tbl.comp_res2 = "Not Completed" end if tbl.change_end(.t.) ndx.drop() tbl.close() e.url = "adv_dependents.a5w"
Comment