Before SAVE Action - JSON Parse Failed
Posted: Thu Jun 23, 2016 6:06 am
In custom code Before Save Action, I have the following code.
if ('#accepted_date#' < '#reported_date#') {
$error='Accepted date must be greater than reported date'';
nuDisplayError($error);
return;
}
if ('#accepted_date#' == '#reported_date#') {
if ('#accepted_time#' <= '#reported_time#') {
$error='Accepted time must be greater than reported time';
nuDisplayError($error);
return;
}
}
It used to work before but suddenly it gave an error JSON Parse Failed. If I remove nuDisplayError() php function out. It works ok.
Any ideas???
2nd. Question. In addition, in the form I enable Print button. When I click on browse form, it causes an error as shown below.
How to correct this error? I noticed that it generate a table with empty column name. It is a bug or I must put some coding.
===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name ''
===SQL===========
CREATE TABLE __576b5f9202ff6f6__ SELECT problem_id,IFNULL(no,'') AS ``,IFNULL(workorder_no,'') AS ``,IFNULL(DATE_FORMAT(reported_date,"%d-%b-%Y"),'') AS `` FROM problem ORDER BY workorder_no DESC, no ASC
===BACK TRACE====
D:\uwamp3.1\www\pm2\nuapi.php - line 333 (nuRunQuery)
D:\uwamp3.1\www\pm2\nuapi.php - line 244 (nuBuildTable)
D:\uwamp3.1\www\pm2\nuapi.php - line 84 (nuGetBrowseHTML)
if ('#accepted_date#' < '#reported_date#') {
$error='Accepted date must be greater than reported date'';
nuDisplayError($error);
return;
}
if ('#accepted_date#' == '#reported_date#') {
if ('#accepted_time#' <= '#reported_time#') {
$error='Accepted time must be greater than reported time';
nuDisplayError($error);
return;
}
}
It used to work before but suddenly it gave an error JSON Parse Failed. If I remove nuDisplayError() php function out. It works ok.
Any ideas???
2nd. Question. In addition, in the form I enable Print button. When I click on browse form, it causes an error as shown below.
How to correct this error? I noticed that it generate a table with empty column name. It is a bug or I must put some coding.
===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name ''
===SQL===========
CREATE TABLE __576b5f9202ff6f6__ SELECT problem_id,IFNULL(no,'') AS ``,IFNULL(workorder_no,'') AS ``,IFNULL(DATE_FORMAT(reported_date,"%d-%b-%Y"),'') AS `` FROM problem ORDER BY workorder_no DESC, no ASC
===BACK TRACE====
D:\uwamp3.1\www\pm2\nuapi.php - line 333 (nuRunQuery)
D:\uwamp3.1\www\pm2\nuapi.php - line 244 (nuBuildTable)
D:\uwamp3.1\www\pm2\nuapi.php - line 84 (nuGetBrowseHTML)