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)
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Before SAVE Action - JSON Parse Failed
-
- Posts: 1
- Joined: Wed Jun 22, 2016 10:54 am
- Location: Thailand
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Before SAVE Action - JSON Parse Failed
somnuk,
If you look in the error log(..UwAmp\bin\apache\logs) you may find what the error is (probably a php error).
Steven
If you look in the error log(..UwAmp\bin\apache\logs) you may find what the error is (probably a php error).
Steven
-
- Posts: 28
- Joined: Sat Apr 30, 2016 2:51 am
Re: Before SAVE Action - JSON Parse Failed
this is related to my reported 'Undefined Error', has something to do with the nuBuilderPro's 'eval' call