Pro-Tipp:
Open the Developer Tools in your browser and check the Console-tab
If something does not work as expected, there may be information there helping you to find spelling mistakes or syntax errors in the Javascript code. There are also warnings from AppGini Helper Library giving hints what may be the problem, for example typos in a fieldname will raise a “missing field” warning.
Browser-Cache
When reloading your page, always clean the browser’s cache. Otherwise the browser may still load and use the previous version of your code.
If you have changed Javascript-code, always reload your page by pressing ...
-
Shift
+F5
orCtrl
+F5
-
Ctrl
+F5
-
Ctrl
+F5
-
Ctrl
+F5
The shortcuts are browser- and even version-specific. There is a Wikipedia article naming all shortcuts here (click here).
Developer tools
In modern browsers open the developer-tools. There is a Console-tab showing debug information, warnings and error messages.
- Check the Console-tab in your browser's developer tools for errors or warnings
- Read the warnings and error messages and try to figure out if there is a syntax error or typo in your javascript code.
-
F12
-
Shift
+F5
-
Ctrl
+Shift
+i
-
F12
Development environment (IDE)
- Install a modern, professional source-code editor like Visual Studio Code which will automatically highlight syntax errors in your code and will give you hints on how to solve them.
Generated application
- Ensure you can open your application in the browser
- Ensure you can login to your application
- Check if you can load the table-view of your table
- Check if you can enter the detail-view of any record in your table
- Re-Generate your application if necessary
Database consistency
- Login as administrator and open Admin-area
- Check if all tables and fields have been generated and configured as modeled in your AppGini project by opening the “Rebuild fields” function
Integration of AppGini Helper
- Attention If you have purchased a version <2019/11, please rename your file
AppGiniHelper.mine.js
toAppGiniHelper.min.js
(remove the "e") - Check that the file
AppGiniHelper.min.js
exists inhooks
-directory. - Check that you have included
AppGiniHelper.min.js
as a JavaScript source inhooks/header-extras.php
.
Page-specfic changes
- Check exact letter-casing of TABLENAME in TABLENAME-dv.js AND TABLENAME-tv.js
I recommend naming all tables in English language and lowercase letters, for example “patients”, not “Patients”.
So the filename will always be lowercase, for example patients-dv.js
and patients-tv.js
, not "Patiens-dv.js” nor “PATIENTS-dv.js” nor "paTIEnTs-dV.Js"
Detail View
- Check that the file named
TABLENAME-dv.js
exists inhooks
-directory
Table View
- Check that the file named
TABLENAME-dv.js
exists inhooks
-directory
Narrow down
- Create a backup (!) of
TABLENAME-dv.js
orTABLENAME-tv.js
javascript file - Comment-out every (!) line of your code
- Then start uncommenting line by line and always check after each line by reloading your page (clear cache)
You will soon see which line(s) cause errors.
Subsequent errors
Please note that javascript code is mostly no longer executed if errors have occurred before. If functions of our libraries do not work, please make sure that your own code works correctly before that and does not cause any errors.
Always watch the console output in your browser's development tools!
We cannot provide free support if it is a follow-up error.
Quotes in SQL commands
Different quote marks have different meaning in SQL commands:
Backticks `
Use backticks `
to wrap tablenames and fieldnames
SELECT `table`.`id` FROM `table`
Single Quotes '
Use single quotes ' to wrap values
SELECT count(*) FROM `table` WHERE `status_id` = '5'
SELECT DISTINCT(`firstname`) FROM `table` WHERE `lastname` = 'Fisher'