The AppGini Blog
A few tips and tricks to make your coding life a tiny bit better.

New features in AppGini 5.80: An in-depth look

I’m so delighted to announce the release of AppGini 5.80. The new version includes some exciting new features that will add more power to your apps and save you more time. This post takes a thorough look into those new features.

Calculated fields

Calculated fields are read-only fields that get populated automatically with a value calculated from any formula you specify. The formula for a calculated field must be a MySQL-compatible SQL query that returns a single value. The value returned from the SQL query is saved to the calculated field whenever the record containing that field is accessed by users.

Calculated fields can be very helpful in numerous scenarios. For example, to automatically calculate and update the subtotal and total of an invoice, number of students enrolled to a course, average score of course, due date of an invoice (for example if you want to set a business rule to set a due date of an invoice to 15 days after issue date), most recent status of a shipment, flag overdue tasks, indicate if prospect customer should be contacted today … etc. There are endless possibilities to applying calculated fields.

To set up a calculated field, 1. set the field as read-only, 2. click the Calculated field tab, 3. check the option Automatically calculate the value of this field using the following SQL query, 4. finally, either type the SQL query in the text area, or click the Query helper button for a quicker and more precise query entry form.

The query helper window

The query helper window allows you to quickly insert various special code pieces into your SQL query. You can insert special variables, field names, SQL functions, or JOIN statements that join the table of the calculated field with one or more of its parent or child tables. This not only saves you time for manually typing these snippets, but also reduces typos and syntax errors.

For more details and example SQL queries for common scenarios, please refer to the calculated fields page in the online help.

Automatically copy child records when copying parent

You can enable this option from the Parent/Children settings window of the parent table. From there, select the child table from the grid at the left, and check the option Copy child records when copying parent. This would copy child records if the user copies the parent record by clicking the Save As Copy button. The lookup field in the copied child records would be automatically set to the new parent record. This is a very handy feature for scenarios like duplicating an order and all its order items, a product, and all the items in its bill of materials, … etc. It saves users the time to manually add child records from scratch.

Enhanced UI of group permissions page for faster editing

We made some time-saving enhancements to the group permissions page. Under the Admin area, open the Groups menu and click on View groups to see a list of configured user groups. Click on any of the groups listed to open its permissions page, where you can configure how the users under this group can access each table in your AppGini application.

What we added in this new release is a button with a checkmark to the right of each permission. Click this button to open a menu where you can select a permission value to apply to all tables at once. For example, if you want that user group to view only that group’s records in all tables rather than all records, click on Set all to Group, as shown in the screenshot to the left. This would select the Group option for all tables, saving you the time to select it manually for each table.

We did the same for tables as well. So, you can open the checkmark button to the right of any table, and select a permission value to apply to all permissions of that table.

Enhanced UI for ‘Specify output folder’ window

[Specif output folder] window

This is the window that appears when you click Generate PHP application in AppGini, asking you to specify the location where you want to generate your app files. We added 3 new buttons above the output path box in this window. The one to the left allows you to go one level up the currently specified folder, the Same as project file button changes the folder to the one where your AXP project file is saved, and the Last used folder changes the folder to the one you last used. This can save you some time browsing complex folder structures.

Enhanced file upload UI with minimum frustration!

We made some slight enhancements to the file upload UI, displaying file type/size errors before submitting changes, and allowing users to clear the upload field. This saves users the frustration of waiting for a large and slow upload to finish, then see a daunting error message about wrong file type or too large size. Now, they can know this instantly, before anything is uploaded.

Smart enhancements to auto-complete drop-downs

When you define a field as a lookup field, or an options list (with 5 options or more), it’s displayed to users in the detail view in the form of an auto-complete drop-down. User can type a few characters and see a list of matching items. As of AppGini 5.80, those searches return more relevant items first, and the matching part of each item is highlighted more clearly. For example, in the above screenshot, typing ran displays the items that begin with ran first, followed by those containing ran.

Developer/admin technical documentation

You can now add technical documentation for your application, and for each table and field. Technical documentation can be kept inside the project, or optionally included in the admin area of the generated app. HTML tags are allowed, so you can include formatted text and links, images, or even embed videos. You can also use Bootstrap 3 CSS classes.

API changes

  • Added the following functions to the JavaScript API (accessible in JavaScript code you add to hooks):
    • AppGini.repeatUntil({action, condition, interval}) this is an alternative to the standard JavaScript function setInterval() that repeats a callback function action every interval milliseconds and stops when condition callback function returns true.
    • AppGini.currentTableName() returns the current table name as a string.
  • Added the following functions to the PHP API (accessible in PHP code you add to hooks):
    • get_parent_tables($table_name) returns an array of parent tables for given child table.
    • curl_batch($handlers) executes provided array of cURL handlers asynchronously, ignoring server responses.
    • jwt_* this is a group of functions for handling JWT authentication to allow API functionality in future releases. We’ll provide a more detailed documentation as future releases become fully API-ready.

Other fixes and enhancements

  • Bug fix in Edit record ownership page.
  • Preserve table view settings when going back from TV using the top left (table name) link, just like when clicking Cancel/Back button.
  • Fixed: Changes to rich text (nicedit) are not detected by the Save changes button.
  • When saving CSV files, set the name to include date and time to make it easier to version CSVs if users are downloading them frequently.
  • Fixed: Prevent triggering of auto-loading for PHPMailer and Notification classes.
  • Added a UI hint for lookup fields that have custom queries.
  • Fixed a potential run time error when resetting a custom query to default one for a lookup field.
  • Fixed: Configured data format for field should take priority over default date/time formatting in both table view and detail view.
  • Fixed a bug that lead to failure generating some files when some special UTF8 characters are used in table/field captions.

How to get the latest version of AppGini?