i am getting an error 'incorrect data type' i have declared the variable as N and the field being compared is also N. do i need to convert e.rtc? how would i do this?
ongridexecute
afterupdaterecord
thanks
ongridexecute
Code:
dim Age1 as N dim Age2 as N dim MaxTerm1 as N dim MaxTerm2 as N dim stateage as N age1 = lookup("[PathAlias.ADB_Path]\casefile.dbf","caseref = "+quote(session.caseref),"age1") age2 = lookup("[PathAlias.ADB_Path]\casefile.dbf","caseref = "+quote(session.caseref),"age2") stateage = "66" [COLOR="#FF0000"]MaxTerm1 = stateage-Age1[/COLOR] MaxTerm2 = stateage-Age2 e.rtc.MaxTerm1 = MaxTerm1 e.rtc.MaxTerm2 = MaxTerm2
Code:
'if term exceeds retirement age for applicant 1 open case risk' ' check if this statement has already been set - prevents duplication if the adviser re-visits this page Dim cr_terminretire as L cr_terminretire = lookup("[PathAlias.ADB_Path]\progress.dbf","caseref = "+quote(session.caseref),"cr_terminretire") if cr_terminretire = .f. then [COLOR="#FF0000"]if e.DataSubmitted.prod_termclientchoice > e.rtc.MaxTerm1 then[/COLOR] dim tbl as p tbl = table.open("[PathAlias.ADB_Path]\case_risk.dbf") tbl.enter_begin() tbl.caseref = session.caseref tbl.adviser = session.adviser tbl.risk_reason = "Term into Retirement" tbl.risk_area = "Mortgage Term" tbl.risk_details = "The mortgage term will extend beyond the clients state retirement age, this may afect affordability once state retirement age has been attained." tbl.risk_value = "5" tbl.action_req = "Detail how the client will maintain the mortgage payments once they have reached state retirement age, ensure that sufficient evidence is held on file to justify affordability." tbl.risk_satisfied = "No" tbl.enter_end() tbl.close() end if 'set the value in the progress table to .t. to prevent future duplication. 'Open track table to edit record dim tbl2 as p tbl2 = table.open("[PathAlias.ADB_Path]\progress.dbf") 'Find the record that has to be edited query.filter = "caseref = " +quote(session.caseref) query.order = "" query.options = "" tbl2.query_create() tbl2.change_begin() tbl2.cr_terminretire = .T. tbl2.change_end(.t.) tbl2.close() end if
Comment