dear UG,
I recently wrote a script that is supposed to perform an after submit function on a form, i have uploaded it but it keeps giving me a error when i try to use the form
'' you cannot submit this form due to an unexpected error''
What could be the cause of this error
thanks
your
ERP
Jaxer.load("uncheck");
//Call up all the variables
//Name all the fields involved.
// The function for the confirm should be provided
function savebutton() {
var nlapiGetFieldValue('custrecord_returned');
var nlapiGetFieldValue('custrecord_date_returned');
var nlapiSetFieldValue('Custrecord_available');
var returnedmsg;
var lentoutmsg;
var notsavedmsg;
var nodatemsg;
var noreturnedbuttonmsg;
//A brief description of all the variable for the alert messages
returnedmsg = 'The Book has successfully Returned';
lentoutmsg = 'You Have sucessfully Lent Out a Book';
notsavedmsg = 'Record Cannot Be Saved';
nodatemsg = 'You Have Not Added a Date Yet';
noreturnedbuttonmsg = 'You Have not Checked the Returned Button Yet';
// Call the fields and check their values against various conditions
if ('custrecord_returned'==TRUE && 'custrecord_date_returned'==FALSE)
{
// prompt the user to select a confirmation
// yes or no
return disp_confirm ()
{
function disp_confirm()
{
var r=confirm("Press a button");
if (r==true)
{
alert("You pressed OK!");
// pop up alert based on the validations made
alert (nodatemsg);
alert (notsavedmsg);
}
else
{
alert("You pressed cancel!");
return false;
}
}
}
}
// Call the fields and check their values against various conditions
if ('custrecord_returned'==FALSE && 'custrecord_date_returned'==TRUE)
{
// prompt the user to select a confirmation
// yes or no
return disp_confirm ()
{
function disp_confirm()
{
var r=confirm("Press a button");
if (r==true)
{
// pop up alert based on the validations made
alert("You pressed OK!");
return true;
}
else
{
alert (noreturnedbuttonmsg);
alert (notsavedmsg);
alert("You pressed Cancel!");
}
}
}
}
// Call the fields and check their values against various conditions
if ('custrecord_returned'==FALSE && 'custrecord_date_returned'==FALSE)
{
// prompt the user to select a confirmation
// yes or no
return disp_cornfirm()
{
function disp_confirm()
{
var r=confirm("Press a button");
if (r==true)
{
// pop up alert based on the validations made
alert("You pressed OK!");
return true;
}
else
{
alert("You pressed Cancel!");
alert (lentoutmsg);
}
}
}
}
// Call the fields and check their values against various conditions
if ('custrecord_returned'==TRUE && 'custrecord_date_returned'==TRUE)
{
// prompt the user to select a confirmation
// yes or no
return disp_cornfirm()
{
function disp_confirm()
{
var r=confirm("Press a button");
if (r==true)
{
// pop up alert based on the validations made
alert("You pressed OK!");
alert (returnedmsg);
nlobjRecord.setFieldValue = (custrecord_avalable ==TRUE);
}
else
{
alert("You pressed Cancel!");
return false;
}
}
}
}
// include the label that calls the function
}