I am attempting to re-write some lotusscript code in Javascript for use on the web. I have a timesheet form that takes the date & payroll number to build a key and check for a duplicates. I am trying to put the code in a function in a JS Header, but I’m missing something called a Before statement. Can someone please take a look at this code and tell me what am I doing wrong?
Thanks Orlando
function check4duplicate() {
var payrollnum=document.forms[0].payrollnum;
var wkend=document.forms[0].weekend;
paykey=wkend+payrollnum;
// Database db = agentContext.getCurrentDatabase();
view view = db.getview(“timepay”);
Document dupdoc=view.getdocumentByKey(paykey, false);
if (doc != numm)
alert("A timesheet already exist for this date");
} catch(Exception e) {
e.printStacTrace()
}