Hello All,
I have a grid containing two checkboxes. Checkbox 1 is Logical mapped to field (Disposal_Request) and checkbox (label) 2 mapped to (Asset_id) has freeform enabled with the following code;
When checkbox 1 is checked my CanUpdateRecord code kicks in nicely, which updates the fields in a table;
When checkbox 2 is checked the AfterUpdateRecords event kicks in nicely, which creates a PDF and opens the send email page;
The problem is with having 2 checkboxes for effectively one function. I am trying to reduce this whole process down to 1 checkbox. Thus, when a single checkbox is checked, the CanUpdateRecords and AfterValidateRecords complete.
Any help will be appreciated.
Thanks
Denis
I have a grid containing two checkboxes. Checkbox 1 is Logical mapped to field (Disposal_Request) and checkbox (label) 2 mapped to (Asset_id) has freeform enabled with the following code;
Code:
<input type="checkbox" name="dasset_id[]" value="{asset_id}">
Code:
function CanUpdateRecord as v (DataSubmitted as P, Args as p, PageVariables as p, Result as p ) with PageVariables Result.Cancel = .f. Result.ErrorHTML = "" DataSubmitted.D_REQUEST_DATE=date() DataSubmitted.ASSET_STATE="Disposal Requested" DataSubmitted.REQUEST_NO=time("ddmmyy0h0m0s") DataSubmitted.REQUESTED_BY=session.vuser_id 'DataSubmitted.DISPOSAL_REQUEST=.T. 'dasset_id[] = "{asset_id}" end with end function
Code:
function AfterUpdateRecords as v (Args as P, PageVariables as P) with PageVariables 'Save Report to File IF eval_valid("dasset_id")= .f. then goto skipreport end if dim filter as c dim order as c dim aid as C dim filename as C aid = dasset_id.dump() aid = remove_blank_lines(aid) aid = *for_each(x,"asset_id = " + quote(x),aid) filter = stritran(alltrim(aid), crlf(), " .or. ") Order = "" filename = "C:\Documents and Settings\Denis\My Documents\Alpha Reports" + chr(92) + "tempreport" + rand() + rand() + ".pdf" filename = report.saveas("rptassets@<adb_path>\assets.ddd","pdf",filter,order,filename,.f.) skipreport: session.filename = filename end with end function currentform.RedirectTarget = "send_email.a5w"
Any help will be appreciated.
Thanks
Denis