Add companies page: browser behavior

Usually, you will reach the insert company page from the companies list:

  

The insert page looks like this:

  

If you type data in the form fields, and then click on Insert Record, a new entry will be added to the company's table and the browser will be redirected back to the list.

Now let's see how the generated page behaves when inserting companies.

 

A lot of improvements have been brought to the error reporting engine:

  1. First, errors are now shown per field, together with a global page error. In our case, we will receive an error for the name_com field, saying that the field cannot be null. In order to understand what field has an error, the tNG3 engine will parse the error message and try to detect the problematic field.
  2. Second, you will see several links that will show you various debug information.
 

As you can see, the page section that threw the error will be highlighted in red, and you'll also see the tNG3 execution flow - starter triggers, before trigger , the actual SQL transaction, after triggers and finally end triggers.

 

You can also check what happens when an error is found for a field. In this case, if you leave the Name field empty for a company, but enter a valid address, the page will indicate the error for the empty field. The Address field value will be preserved, to prevent the huge annoyance of loosing the submitted data on error:

 

You should feel pretty confident with these professional features for error handling that will help you build your web applications much faster than before, and that will also help your clients understand what went wrong when an error happens on the server.

While you will surely appreciate the detailed error messages in this form, you should also know that you can move a site in Production mode and thus avoid showing all those errors to the final client (you will be able to either log the detailed errors in a file or send them by e-mail to you). To find out more about this matter, check the Control Panel settings here. And this is how the errors is displayed in a production page:

 

After having completed the company insert page, you can move on and learn how to create the update page. It will allow you change information already entered for a company.