Page 1 of 1

Before SAVE Action - JSON Parse Failed

Posted: Thu Jun 23, 2016 6:06 am
by somnuk
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)

Re: Before SAVE Action - JSON Parse Failed

Posted: Mon Jun 27, 2016 5:05 am
by admin
somnuk,

If you look in the error log(..UwAmp\bin\apache\logs) you may find what the error is (probably a php error).

Steven

Re: Before SAVE Action - JSON Parse Failed

Posted: Mon Jul 04, 2016 11:29 pm
by hanstel
this is related to my reported 'Undefined Error', has something to do with the nuBuilderPro's 'eval' call