0% found this document useful (0 votes)
326 views

nuBuilderForte UserGuide

nuBuilder Forte is a web-based open source application for creating database applications using SQL, PHP and JavaScript. It allows users to build forms to manage data from a database, as well as reports and procedures. The document provides an overview of navigating and customizing nuBuilder, including creating access levels and users, building forms and reports, and updating the application.

Uploaded by

Jemal Dawud
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
326 views

nuBuilderForte UserGuide

nuBuilder Forte is a web-based open source application for creating database applications using SQL, PHP and JavaScript. It allows users to build forms to manage data from a database, as well as reports and procedures. The document provides an overview of navigating and customizing nuBuilder, including creating access levels and users, building forms and reports, and updating the application.

Uploaded by

Jemal Dawud
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

User Guide ​(version 2)

Page No.: 1
Introduction to nuBuilder Forte

Navigating nuBuilder
Home Page
Globeadmin Home
User Home
Run Procedure
Run Report
Setup
Access Levels
User
Forms
Objects
Files
Fast Form
Procedures
Reports
Fast Report
SQL
Format
Translation
Database
Update
Browse Form
Edit Form

Builders
Fast Form
Fast Report
SQL Builder
Format Builder
Translation Builder

Customising nuBuilder Elements.


Forms
Objects
Arranging Objects
Reports
Arranging Objects
Procedures
Hash Cookies

Creating an Invoicing Application


Create Forms and Tables
Edit Form Properties

Page No.: 2
Arrange Objects
Edit Object Properties
Edit These Objects.
Create an Invoice Docket
Build SQL
Create Fast Report
Edit Report
Add Action Buttons

Page No.: 3
Introduction to nuBuilder Forte

nuBuilder Forte is the 4th version of nuBuilder. It is web based, open source and is used for creating database
applications with SQL, PHP and Javascript. All code used to customise is stored in the database and backed up

nuBuilder can be used to create business applications that manage data from a mySQL or MariaDB database. From
maintaining simple customer records​ to ​building a full accounting system​. This is done using Forms to search
and edit data and Reports to print data.

Navigating nuBuilder

nuBuilder Forte is easy to navigate. Each Form (or screen) is either a Browse Form or an Edit Form. When you first
log into nuBuilder you will see a Home Page (Edit Form) appear in front of you. This Form will have buttons that can
then take you to other Forms...

Page No.: 4
Home Page

Globeadmin Home

If a user logs in as globeadmin they will see a


(Home Page) Edit Form with Tabs and
Buttons that will lead to different elements of
nuBuilder’s development tools.

User Home

If a user logs in with any other username they


will be taken to a Home Page created by
globeadmin for users of other Access Levels.
eg.

The User Home Button will take you to a Launch Form where Buttons are automatically placed when creating a
Browse / Edit​ Form using Fast Form.

Page No.: 5
Run Procedure

This Button gives Globeadmin access to the list of Procedures available.to run.

Run Report

This Button gives Globeadmin access to the list of Reports available to run.

Setup

Click the Setup Button on the Setup Tab of the Home Form to edit the following…

Time Zone

Language

Set the language for the globeadmin user.

Page No.: 6
Email Settings

Auth SMTP settings required...

● User Name
● Password
● Host
● From Address
● From Name
● Port
● Use SSL
● Use Authentication

Page No.: 7
Header

The Header is placed in the HTML5 header of nuBuilder Forte and can be used for adding...

● Javascript libraries
● Javascript functions
● Style Sheets
● CSS Styles

Eg.

<html>
<header>
<script>

//- Any function in this script tag will be available anytime within nuBuilder.

function nuHeaderTest(){

console.log('Functions placed here before a closing script tag are available


anywhere in nuBuilder Forte');
}

</script>

<script type="text/javascript"
src="https://www.gstatic.com/charts/loader.js"></script>

<style>
.nuActionButton { background : orange; //-- personalise your Action Buttons
</style>

<script>

Page No.: 8
Access Levels

Once you have created your required Forms, Reports and Procedures you will need to give users access to them.

To do this you need to do 2 things

1. Create an Access Level.


2. Add a User.

Home

Choose the Form for this Access Level.

When you log in as a developer the first thing you see is the ​Home Page​.

Each Access Level requires a ​Home Page​, which will be its starting point for Users with this Access Level.

This ​Home Page​ should be a Launch Form.

The code for the default User Home Page is nuuserhome (the same as User Home on the Setup Tab).

Code

Lookup code for this Access Level

Description

Description of this Access Level

Page No.: 9
Forms

Add Forms that will be available to this Access Level.

Click the checkbox to enable the following on this Form for this Access Level.

● Add
● Print
● Save
● Clone
● Delete

Page No.: 10
Reports

Add Reports that will be available to this Access Level.

Procedures

Add Procedures that will be available to this Access Level.

Page No.: 11
User

Name

User's real name

Email

Email address

Language

Select a language with a translation in Translations.

If left blank it will just use the phrases used in nuBuilder.

Access Level

Select a previously defined Access Level.

Login Name

nuBuilder Login Name

Enter New Password

nuBuilder Login Password

Only used when changing passwords.

Re Enter New Password

Repeat nuBuilder Login Password

Only used when changing passwords.

Page No.: 12
Forms

Objects

Files

nuBuilder Forte has an ​Upload File​ facility and an ​Input:File​ Object is to allow simple things like photos, pictures or
logos. Because files are converted to JSON it's not practical to use this as a general method for storing bigger files
over 300 Kb. As the conversion process can take a while.

Upload File

Upload or drag a file here.

Files are stored in nuBuilder Forte, in a JSON format that can be used in an HTML EMBED object...

{"file":"ZGF0YT...SlJVNUVya0pnZ2c9PQ==","name":"nu_icon.png","size":21598,"type":"image/png"}

Code

Add a Lookup Code

Description

Add a Lookup Description

Group

Used to sort Images in a Browse Form.

Page No.: 13
Fast Form

Procedures

Reports

Fast Report

SQL

Format

Translation

Database

phpMyAdmin will give nuBuilder developers direct access to the database.

It is a free software tool written in PHP, intended to handle the administration of MySQL over the Web.

phpMyAdmin supports a wide range of operations on MySQL and MariaDB.

Frequently used operations can be performed via the user interface, while you still have the ability to directly execute
any SQL statement.

Page No.: 14
Those operations are..

● managing databases
● tables
● columns
● relations
● indexes
● users
● permissions

Update

Whenever a new update is pulled from ​Github​ it includes a file called nubuilder4.sql

This is used by the Update Button on the Builders tab on the Home Page, to make any changes to the current
database.

The Update Button should be run each time files are pulled from Github or Sourceforge.

Page No.: 15
Browse Form

Clicking a button on the Home Page will generally take you to a Browse Form.

● Breadcrumbs - Allows Users to retrace back through Previously opened Forms.


● Action Buttons - Actions that can be taken on this Form.
● Log out
● Search for strings - Filter records by searching for strings found in that record.
● Click to edit record - View this record on an Edit Form.
● Page Navigation - Move back and forth through Browse Form pages.
● Options.

● Search Columns - Select only specific columns.


● Form Properties - View/edit this Form’s properties.
● Form Object List - A Browse Form of all Objects on this Form.
● nuDebug Results - A Browse Form used for debugging.
● Refresh - Rebuilds this Form with the latest information from the server.
● Search - The same as hitting the Search Action Button.
● Add - The same as hitting the Add Action Button.
● Print - The same as hitting the Print Action Button.

Page No.: 16
Edit Form

Adding or selecting a record from a Browse Form will take you to an Edit Form.

● Breadcrumbs - Allows Users to retrace back through Previously opened Forms.


● Action Buttons - Actions that can be taken on this Form.
● Log out
● Tabs.
● Choose from another table’s Browse Form.
● Subform row delete checkbox.
● Form Options.
● Arrange Objects - Drag/ Drop and reorder Objects on the Edit Form.
● Form Properties - View/edit this Form’s properties.
● Form Object List - A Browse Form of all Objects on this Form.
● nuDebug Results - A Browse Form used for debugging.
● Refresh - Rebuilds this Form with the latest information from the server.
● Save - The same as hitting the Save Action Button.
● Delete - The same as hitting the Delete Action Button.
● Clone - The same as hitting the Clone Action Button.
● Open any custom help.

● Subform Options.

● Arrange Objects - Drag/ Drop and reorder Objects on the Edit Form.
● Form Properties - View/edit this Form’s properties.
● Form Object List - A Browse Form of all Objects on this Form.
● Open any custom help.

Page No.: 17
Builders

Fast Form
To create a Form that will allow for searching and editing records in a table, the easiest way is by creating a Fast
Form.

A Fast Form can do the following…

● ​ orm
Create a ​BrowseEdit F
● Use an existing table or create a new table in the database.
● Add fields to the Browse Form
● Add Objects to the Edit Form
● Create a button to access the new Form.

1. Select ​Browse and Edit​.


2. Scroll through the list of available tables or add the name of the new table you want to create.

Repeat the following for adding each Object...

3. Click on an Addable Object.


4. Add the Object’s Label
5. Scroll through the list of fields for the chosen table or add the name of the new field for a new table..
6. Check ​Browse Column​ if this ​Field Name​ is to appear in the Browse Form.

Page No.: 18
After adding all Objects...

7. Click ​Build Fast Form​.

This will result in the following message…

Creating this ​Browse / Edit​ Form with the Fast Form Builder will create the following…

A Button Object to open the new Form.

A Browse Form

An Edit Form.

Page No.: 19
Fast Report
To create a Report that can list and total fields, the easiest way is to use a Fast Report.

1. Select ​Table Data​. (This is a list of table, SQL and Procedures that can be used)
2. Select the field to order the report by.

Repeat the following for adding each Object...

3. Choose ​Addable Fields​.


4. Edit field title.
5. Adjust field width
6. Click to Sum this field on the report footer.

After adding all fields...

7. Click ​Build Fast Report​.

This will result in the following message…

Page No.: 20
Creating this Report with the Fast Report Builder will create the following Report.

Creating this Report with the Fast Report Builder will also create the following record in the ​Report Builder t​ hat can
be further customised .

Page No.: 21
SQL Builder

The SQL builder only creates SQL SELECT statements.

These records can be used to create ​Tables​ used in ​Reports​.

The SQL Builder can also be accessed via the ​SQL​ button next to any nuBuilder Forte Textarea Object requiring SQL.

1. Description ​- ​Description for this SQL query.


2. Add Table​ - ​Choose tables to add to ​Field and Relationships.
3. Field and Relationships ​- ​This is a graphical way to create table relationships.

Page No.: 22
Each table can be dragged by clicking on the table name.

Each table added has...

● A Tablename.
● A field that will allow you to enter an alias for this table.
● A list of fields belonging to this table.
● A checkbox at the left of each field name allowing that field to be chosen.
● A checkbox at the top left allowing all fields to be chosen at once.

To create a relationship between 2 tables you need to do 2 things.

1. Click the first field as you hover over it and its name becomes red.
2. Unclick as you hover over a field on another table when its name becomes green.

This will create an orange line to represent this relationship.

When hovering over an orange line you will see its join type.

You can change this join type by double clicking it.

4. Clauses

Type

There are 4 types of clauses that can be added using the SQL Builder.

1. WHERE
2. GROUP BY
3. ORDER BY
4. HAVING

Field

This is a ​scrolling​ list of available field names.

Clause

Used by WHERE and HAVING. eg. = 1234

Hash_Variables can also be used. eg. = '#RECORD_ID#'

Order

Used by GROUP BY and ORDER BY. eg. ​ASC or DESC

5. SQL -​ ​SQL Code Built from ​Graphical User Interface​ that can be manually edited.

To further edit this, double click on the field and you will open ​Ace Editor​ in a full screen.

6. Resize -​ Resize ​Fields and Relationships​.

Page No.: 23
Format Builder

The Format Builder will allow you to create custom formats for ​nuDate​ and ​nuNumber​.

To create a Format we need to do 2 things.

1. Choose the Data Type.


2. Build the Format.

Building a nuDate

To build a date format, click on a combination of the following options.

Entering a Date with the keyboard requires the user to enter the date in the exact format.

eg. ​mask - r​ esult​ ​(2007-13-01 15:20:01)

● yy - ​17
● yyyy - ​2017
● pp - ​am​ or ​pm
● dd - ​21
● ddd - ​Tue
● dddd - ​Tuesday
● mm - ​03
● mmm - ​Mar
● mmmm - ​March
● hh - ​15
● nn - ​20
● ss - ​01
Page No.: 24
.. and some punctuation.

Building a nuNumber

To build a number format, click on 1 of 4 punctuation types.

Any number entered will be reformatted by the field's onchange event.

1. 1000.
2. 1000,
3. 1,000.
4. 1.000,

● To the left of these choices is a ​nuScroll​ Object that will allow you to add a currency sign.
● To the right of these choices is a ​nuScroll​ Object that will allow you select the number of decimal places.

This prefix and suffix of the Format will be added when a punctuation type is selected.

Page No.: 25
Translation Builder

This allows you to make alternative phrases in other languages that can be used instead of nuBuilder Forte's English
(Australian) phrases.

Language

The ​User's​ language.

English

A phrase used in nuBuilder Forte.

Translation

A phrase used in this language.

Page No.: 26
Customising nuBuilder Elements.

Forms
The first thing you will see after logging into nuBuilder Forte is a nuBuilder Launch Form containing Button Objects
that will take you to other Forms.

This is also referred to as a Home Page.

There are 5 types of Forms.

1. Browse - A selectable list of records from a database table used by ​Lookup Objects​.
2. Edit - An area displaying editable fields from a record in a database table.
3. Browse and Edit - A Form to select and then edit a record in a database table.
4. Subform - An Edit Form that is repeated inside a Subform Object.
5. Launch - A Form not associated with a database table.

A Browse is used by a Lookup Object to select a record from another table.

You can build a Form (and create a ​Button​ to Access that Form) the easy way using the ​Form Builder​.

OR...

You can create a new Form the long way by...

1. Clicking the Form Button on the Setup Tab of the Home Page.
2. Clicking the Add Button at the top of a Browse Form.
3. Filling out your new Form's properties (see below). We suggest you make your first Form a ​Browse
and Edit​.
4. Clicking the Save Button at the top of its Edit Form.
5. You will need to add a ​Button​ to the Home Page so users can open it.
6. And then you'll want to add some ​Objects​ to your new Edit Form, for displaying and editing fields.

Page No.: 27
Form Type

Choose 1 of the following.

● Browse - Used by a Lookup Object.


● Edit - Used to display editable fields from a record in a database table.
● Browse and Edit - Used to find a record and then display it.
● Subform - Used inside a Subform Object.
● Launch Used...
● As a Home Page
● A Form to display other nuBuilder Objects
● For adding criteria to a Report.

Code

A unique code of alphanumeric characters.

Description

Form description.

Table Name

The database table containing records and fields to display.

This is not required for Launch Forms.

Page No.: 28
Primary Key

The Primary Key belonging to the selected Table.

This is not required for Launch Forms.

Tabs

All Form types, apart from ​Browse​ Forms, require at least one Tab.

Tabs are arranged horizontally above the editable area of an Edit Form.

Tabs allow users to navigate (what seems like) different layers on the same Form.

Title

Tab Title

Order

Displayed order of the Tabs. - Every time the Form is saved these records this will be reordered and renumbered in
multiples of 10.

Help

Javascript that can run to help the user eg. ​window.open('www.help.com.')​ or ​nuMessage(['You must fill in','all
fields.']);

SQL

If you want any help building SQL, the SQL Button will direct you to nuBuilder's ​SQL Builder​.

This SQL is used to display records on a Browse Form

OR

Page No.: 29
used by Subform Objects to order records inside the Subform.

Columns
Title

Column Title

Display

Table Field Name

Align

Left, Right or Center

Format

Used for formatting dates and numbers - The Formatted part of results are not searchable. (Don't search for a ​$​ if it's
not in the actual record.)

Width

Width of column

Order

Order of column. - Every time the Form is saved these records this will be reordered and renumbered in multiples of
10.

Row Height

Height in pixels

Rows Per Page

If '0' then all rows will be displayed, if a number fewer than the rows in the database, it will show the remaining rows
on a separate page

Redirect To

Redirects the choice made this a Browse Form to another Edit Form.

Page No.: 30
PHP Code

PHP code can be added at the following places on a Form.

● BB​ - Before Browse


● BE​ - Before Edit - not available in Subform Forms.
● BS​ - Before Save - not available in Subform or Launch Forms.
● AS​ - After Save - not available in Subform or Launch Forms.
● BD​ - Before Delete - not available in Subform or Launch Forms.
● AD​ - After Delete - not available in Subform or Launch Forms.

These sections are explained in the flowchart below.

Javascript

A Textarea containing Javascript code - not available in Subform Forms.

To edit this, double click on the Textarea and you will open ​Ace Editor​ in a full screen.

This Javascript can be used on all Forms except for Subforms.

JS​ in the flowchart below.

Page No.: 31
Page No.: 32
Objects

Tab:All

Form Tab

Select a Form's Tab to add this Object to.

Type

Choose one of the following.

● Calc - A number field that recalculates after each change made on the current Edit Form.
● Display - A read only field that will display the first field of the first record from a SQL Select statement.
● HTML - A read only area that can be used to display html.
● Image - A read only area that will display an image.
● Input - Generally used for entering text, it can also be used for other HTML5 Input types, along with some
types exclusive to nuBuilder Forte.
● Lookup - A lookup allowing the selection of a value from another table.
● Run - Does 1 of 2 things.
1. Creates a Button to allow the user to run another Form, Report or Procedure.
2. Creates an iFrame on an Edit Form in which a Form, Report or Procedure is displayed.
● Select - Allows the selection of one or more values from a list.
● Subform - Can contain rows (Subform Forms) that relate to the Edit Form.
● Textarea - Allows for text with carriage returns.
● Word - A read only object that simply creates a phrase in Bold.

Label

Description of Object.

Page No.: 33
ID

A valid HTML element id that is unique to this Edit Form.

Top

Value in pixels.

Left

Value in pixels.

Width

Value in pixels.

Height

Value in pixels.

Cloneable

Yes or No.

If set to No on an invoice number Object.

It would mean that the whole record is cloned but its invoice number is not.

Used by...

● Calc
● Input
● Lookup
● Select
● Textarea

Align

Left, Right or Center.

Used by...

● Calc
● Display
● Input
● Textarea
● Word

Validation

None, No Blanks or No Duplicates.

Used by...

● Input
● Lookup
● Select
● Textarea

Page No.: 34
Access

Editable, Readonly or Hidden.

Tab:Run

This Object will either...

● Create a Button that will open a Form, Report or Procedure in a new ​Breadcrumb​.
● Display a Form, Report or Procedure, inside an iFrame on the Edit Form.

Run

Choose Form, Report or Procedure to run.

Filter

A string that will be used like the ​Search​ field to filter Browse records.

Hash Cookies​ can be used in this string.

Record ID

Entering a Record ID will make the record with the matching ID display in an Edit Form (skipping the Browse Form)

Hash Cookies​ can be used in this string.

Method

Choose Button or iFrame.

Button​ will create a button that will take you to the Form, Report or Procedure.

iFrame​ will mash an iFrame into the existing Edit Form that will display the Form, Report or Procedure.

Page No.: 35
Tab:Display

SQL

A valid SQL query that will display the first field of the first record from its result.

If you want any help building SQL, the SQL Button will direct you to nuBuilder's ​SQL Builder​.

Ash Cookies can be used within the SQL statement.

Eg.

SELECT cus_name FROM customer WHERE customer_id = '#RECORD_ID#'

Page No.: 36
Tab:Select

Multiple

Choosing Yes will allow for more than 1 selection from a visible list. Choosing No will allow for only 1 selection from a
dropdown list.

SQL or List

The resulting list for this Object can be created 1 of 2 ways.

1. SQL - A valid SQL query that returns 2 columns - If you want any help building SQL, the SQL Button
will direct you to nuBuilder's ​SQL Builder​.
2. List - A list delimited by a ​| eg. ​0|No|1|Yes

Page No.: 37
Tab:Lookup

A Lookup Object can find and display a record selected from another Browse Form.

Form

Select a previously created nuBuilder Form.

Code

Scroll through to choose the Field to display as the ​lookup able​ Code from the list of possible fields.

Description

Scroll through to choose the Field to display as the Description from the list of possible fields.

Width

The width of the Description field in pixels.

After Browse

Allows ​PHP​ to be run after a record is selected.

AB​ in the flowchart below.

Javascript

Allows Javascript to be run after a record is selected.

LUJS​ in the flowchart below.

Page No.: 38
Page No.: 39
Tab:Subform

A subform is scrolling instances of another Form.

With each having a Delete checkbox on it's right - that will delete that record if ticked when the main Edit Form is
saved. (if ​Deleteable​)

Invisibly linked by a ​Foreign Key​ to the main Edit Form.

This Form can appear in 2 different ways.

1. As an ​Edit​ Form - as normal.


2. In a ​Grid​ format - all Objects in a horizontal row.

Form

Select a previously created nuBuilder Form that will scroll inside this Subform.

Foreign Key

Scroll though to choose the Foreign Key from the list of possible fields.

A Foreign Key is a field that is used to link to another table's Primary Key.

If a Subform's Form has an Object with the same ID as the Subform's Foreign Key, Subform records cannot
be saved.

Page No.: 40
Addable

Select Yes or No

If Yes, there will always be a blank Form at the end of the scrolling list. So that a new record can be added.

Deletable

Select Yes or No

If Yes, each Form will have a Delete checkbox on it's right - that will delete that record if ticked, when the main Edit
Form is saved.

Type

Select Grid or Form.

Inside a Subform, records are repeated either as a

● Form which displays the same as an Edit Form.

OR

● A Grid where each Object is placed in order side by side, making the height of each ​Form​ shorter.

Tab:Image

The Image Object is an easy way to display a specific image stored in nuBuilder ​Files​.

Image

Choose from previously saved images.

Page No.: 41
Tab:Input

A nuBuilder Input allows for most HTML5 input types as well as 4 types just available in nuBulder Forte.

Each of these 4 Objects requires extra information and will display an extra Object when selected.

nuDate

nuDate is a nuBuilder Input field that will display a calendar as it receives focus and will format data entry or calendar
selection, once edited.

It requires ​Format​ - A list of customisable ​Formats​.

nuAutoNumber

nuAutoNumber is a read-only nuBuilder Input field that will be populated once the Edit Form it is on, is saved for the
first time.

It will be populated with an incrementing number.

It requires ​Next Number​ - The number this Autonumber will start from.

nuNumber

nuNumber is a nuBuilder Input field that will format data entry once edited.

It requires ​Format​ - A list of customisable Formats.

Do not enter more than 20 characters.

nuScroll

nuScroll is a nuBuilder Input field that will allow the user to scroll through a list using keyboard up and down arrows
but also allows for adding text, not in the list.

It requires a ​Javascript Array​.

File

Page No.: 42
This is an HTML Object used for selecting a file to upload.

This file is stored in a JSON string and can be used for embedding files inside a div on an Edit Form using
nuEmbedObject().

Other HTML Types

● Button
● Checkbox
● Color
● Datetime-Local
● Email
● Hidden
● Image
● Month
● Number
● Password
● Radio
● Range
● Reset
● Search
● Telephone
● Text
● Time
● URL
● Week

a nuBuilder File Object converts a selected file to a JSON string (this is not an efficient way to handle files over
300kB).

This string can easily be used with HTML5 objects like <EMBED>.

Page No.: 43
Tab:HTML

This Object can be used for displaying custom HTML or a Google Chart.

Chart

Chart Type

● Pie Graph
● Line Graph
● Bar Graph
● Bar Graph - Stacked
● Bar Graph - Horizontal
● Bar Graph - Horizontal and Stacked

Javascript Array

This could be a hardcoded array,

[
['Month', 'Shane', 'Dave', 'Adam', 'Paul', 'Chris'],
['2004', 100, 200, 300, 400, 500],
['2005', 165, 238, 322, 498, 550],
['2006', 165, 938, 522, 998, 450],
['2007', 135, 1120, 599, 1268, 288]
];

or a Javascript function that returns an array like …

nuSubformObject('items').chartData

Page No.: 44
Title

Appears at the top of the Chart.

Vertical Label

Appears at the left of the Chart.

Horizontal Label

Appears at the bottom of the Chart.

HTML

HTML

This will display any HTML that can be put in a DIV.

It can also contain ​Hash Cookies​ and can be used to change the HTML before it is run.

Page No.: 45
Tab:Calc

A Calc Object is a numeric field that will be recalculated after any Object's onchange event.

Format

Choose from a list of customisable ​Formats

Formula

The Formula for this calculation is simply created by clicking a combination of Objects and Operators.

Objects​ is a list of available ​Input:Number,​ ​Input:nuNumber,​ ​nuCalc​ and ​Select​ Objects on the Edit Form.

Options containing a ​.​ refer to the Subform Name and the Input Name on that Subform. And will total up all values for
that Object eg. ​invoice_item_sf.ite_total

Options not containing a ​.​ refer to an Object on the Edit Form eg.​inv_total

Page No.: 46
Tab:Custom Code

If an Object has a Javascript event, the Custom Code Tab will be in bold.

These events are standard HTML5 events such as onclick or onchange.

The exception to this is a Subform Object which has only 3 events.

● beforeinsertrow

(Setting nuCancel = true; in this event, will stop a row being added to the Subform Object)

if(nuSubformObject('item_sf').rows.length > 9){

if(nuSubformRow == 9){
alert('Only 10 rows allowed');
}

nuCancel = true;

● afterinsertrow
● clickdelete

Page No.: 47
Javascript

Event

A valid event name.

Javascript

An Input Object (text field) containing Javascript code.

To edit this, double click on the Textarea and you will open Ace Editor in full screen.

PHP can be run at different event points of a Form’s loading and saving.

Javascript can be used to automate certain user functions or simply change colors on a Form.

Here are the different points along nuBuilder’s Flow that can be customised…

Page No.: 48
Arranging Objects

Once Objects have been placed on an Edit Form they can be Adjusted with the ​Arrange Objects​ Form.

Page No.: 49
Reports

Code

A unique code for this Report

Description

The description of this Report

Group

A field that can be used to help organise Reports.

Table

A Table can be created in 3 different ways.

1. A single table. - (nuTABLE)


2. An SQL statement created with the ​SQL Builder​. - (nuSQL)
3. A PHP ​Procedure​.

A Procedure will only appear in this list if #TABLE_ID# is found somewhere within it.

The point of using a ​Procedures​ is to create a temporary table that can be manipulated before it is used by the Report.

(If a nuTABLE or a nuSQL ​table​ is chosen, this temporary table is created automatically)

The temp table created must be called ​#TABLE_ID#​.

Page No.: 50
#TABLE_ID#​ simply gets replaced by the name of a temporary table, created by nuBuilder, that will be used by the
Report.

It works the same way as other Hash Cookies.

$s = "

SELECT
sta_last_name,
sta_initials,
sta_games,
sta_runs,
sta_captain,
CONCAT(sta_last_name, ',', sta_initials) AS full_name,
1 AS player

FROM
stats

";

nuRunQuery("CREATE TABLE #TABLE_ID# $s");

Launch From

A Launch Form will allow..

● The user defines the information to be stored in the table that will be used by the report.
● Run the Report from an ​Action Button​ at the top of the ​Form​.

Report Designer

nuBuilder Forte has its own Report Designer.

Page No.: 51
Arranging Objects

The nuBuilder Forte Report Designer will open up in a new browser window.

It is a graphical user interface, with drag and drop features, for designing a ​Report​.

9 Functions

New Object
This will add a default Object into the Detail Section of the Report.

Clone Object
Doing this will clone any highlighted Objects.

Cloning an Object often saves more time than just adding an Object.

Select Objects
There are 3 ways to select one or more Objects.

1. Clicking on an Object. Holding the Ctrl Key down will allow you to add another Object to those already selected.
2. Drawing a rectangle around them with your mouse.
3. Clicking ​Select Objects​ on the Menu.

Adjust Object
This will bring up a dialog box with options that can adjust all selected Objects..

● Align To Left
● Align To Right
● Align To Top
● Align To Bottom
● Space Vertically
● Space Horizontally
● Thinnest
● Widest
● Tallest

Page No.: 52
● Shortest

Object Properties

● ID
● Object Type
● Field - Displays a value that comes from the reports ​Table​.
● Label - Displays Text - these can use ​Hash Cookies​.
● Image - Displays a PNG Image.
● Left
● Top
● Height
● Width
● Background Color
● Border Color
● Border Width
● Field Name/Title/Source - ​(Field/Label/Image)
● Field Name - A ​Scrollable​ list that displays a list of values that comes from the report's ​Table​.
● Title - Text that can include ​Hash Cookies​.
● Source - A ​Scrollable​ list that displays a list of values that comes from..
● Field - A Fieldname in the ​Table​.
● Image - A list of nuBuilder Forte ​File​.
● Label - A List with only 1 choice (that can be over written with an actual Label) which is used
to keep the Label to the exact size as its Height Property - KEEP EXACT HEIGHT.
● Font Color
● Font Family
● Font Size
● Font Weight
● Format
● Text Align
● Minimum Rows - In a growable Field Object.
● Maximum Rows - In a growable Field Object.
● Z Index - Objects with larger numbers will appear on top.

Group Properties
This will bring up a dialog box that will allow us to do 2 things.

1. Sort the records into a certain order before printing. - Sorting on up to 8 ​Scrollable​ fields.
2. Format each sections of the Report. - The properties for each Section are..
● Section Height - In pixels.
● Section Color - HTML.
● Section Page Break - Start a new page when completed.
● Yes.
● No.

Report Properties
This will bring up a dialog box with 2 options.

Page No.: 53
1. Paper
2. Orientation

Copy Changes
This will copy the design back to the ​Build Report​ Form and close the ​Report Designer​.

These changes will ​NOT​ be saved until the current ​Build Report​ record is saved!

Functions
There are 2 functions that can be used within Group and Report Headers and Footers.

1. sum() - eg. sum(inv_total)


2. average() - eg. average(inv_total, units)

For these functions to work there must be at least 1 Report Group.

Page No.: 54
Procedures

nuBuilder Forte can create Procedures.

A Procedure is PHP code run to manipulate the database.

Procedures are written in PHP to do things to the database directly.

Here are 2 examples of where a Procedure can be used.

1. To create the ​tab​le used in a Report.


2. Update a stock table after an invoice is created in nuBuilder.

Code

A unique code for this Procedure.

Description

The description of this Procedure.

Group

A field that can be used to help order Procedures in a list.

Launch From

Page No.: 55
This is only necessary if you need it to...

● Run it from the Run Procedure Button.


● Reference Hash Cookies from a certain Edit Form.

It can still be used by nuProcedure().

A Launch Form will allow...

● The user defines the information to be used by the Procedure.


● Run the Procedure from an Action Button at the top of the Form.

Run

● In a new window - Appears in a new window much the same as a Report.


● Hidden - This runs behind the scenes but can display a result using nuDisplayMessage

PHP

A Textarea containing PHP code.

This code can also use Hash Cookies that will help you customise nuBuilder.

To edit this, double click on the Textarea and you will open Ace Editor in full screen.

Page No.: 56
Hash Cookies
● A cookie helps hold values between Javascript and PHP.
● A nuBuilder cookie does a similar thing and has hashes around it eg. ​#USER_ID#​.

There are a number of places Hash Cookies can be used...

In each of these situations, nuBuilder does a search and replace with all currently available Hash Cookies and any you use in your
code before it is run.

There are 5 Hash Cookies always available.

1. USER_ID
2. USER_GROUP_ID
3. HOME_ID
4. GLOBAL_ACCESS
5. ACCESS_LEVEL_CODE

To find what other Hash Cookies are available for use, you can run ​nuHash()​ inside your code.

PHP
Hash Cookies allow you to customise your ​PHP code​.

Example of using Hash Cookies in PHP.

$s = "CREATE TABLE #TABLE_ID# SELECT * FROM invoice";

nuRunQuery($s);

HTML
Hash Cookies allow you to customise your HTML ​Objects​.

The Hash Cookies available to HTML Objects are the same as those available on ​Before Edit​.

Example of using Hash Cookies in HTML.

<iframe
width="560"
height="315"
src="#cus_youtube#"
frameborder="0" allowfullscreen>
Page No.: 57
</iframe>

Custom SQL
All Custom SQL used in nuBuilder Forte.

CREATE TABLE #TABLE_ID# SELECT * FROM customer;

or

<source lang="sql">

SELECT * FROM customer WHERE cus_group = '#sales_group#';

</source>

SQL Builder
Any ​Clause​ in the ​Clauses​ Subform in the ​SQL Builder​.

= '#RECORD_ID#'

Report Labels
Using Hash Cookies allows you to have changing titles on ​Report Labels​.

An example of using Hash Cookies in a Report Label. <source lang="html">

Sales Between '#from_date#' And '#to_date#'

</source>

The following are specific hash variables available only for Report Labels are...

● page
● pages
● description
● code
● year
● month
● day
● hour
● minute
● second

Page No.: 58
Creating an Invoicing Application
This simple application could be used to take phone orders for restaurants or retail stores etc.

It will store the following information in the database.

1. Customer
2. Product
3. Invoice
4. Invoice items

This information will be entered by users through a nuBuilder Form (Invoice Form) that looks like this..

Page No.: 59
Create Forms and Tables
To create the required Forms and tables we will build 4 Fast Forms.

● 3 ​Edit and Browse​ Forms


● 1 ​Subform​.

1.Customer

2.Product

Page No.: 60
3.Invoice

4.Invoice Item

Page No.: 61
Edit Form Properties
Forms created with Fast Forms will require the default Code and Description to something more descriptive.

1. Click the Options icon in the top left corner of a Form or Subform and select ​Form Properties​..

Page No.: 62
Arrange Objects
A Fast Forms builds a Form and adds Objects. These Objects will need adjusting so they appear on an Edit Form in a
tidy logical order. A Fast Form may also create a Button to open the new Form, on the User Home Page (which will
also require adjusting) eg.

2. Click the Options icon in the top left corner of an Edit Form or Subform.
3. Highlight the Objects you want to adjust.
4. Click Save to apply these changes to that Form.

Page No.: 63
Edit Object Properties
Some objects created with a Fast Form have default values that will need editing.

There are 3 ways to view and edit an Object’s properties.

1. Via the Options icon (as above).


1.1. Select ​Form Object List
1.2. Select Object.
2. By double clicking and Object’s Label if it has one.
3. Via the ​Object​ Form on the Setup Tab.

Page No.: 64
Edit These Objects.

● inv_customer_id

On the Lookup Tab.

● Set ​Form​ to Product Form.


● Set ​Code​ to pro_code.
● Set ​Description​ to pro_description.
● ite_product_id

On the Lookup Tab.

● Set ​Form​ to Product Form.


● Set ​Code​ to pro_code.
● Set ​Description​ to pro_description.
● Add the following to ​After Browse​ to update the item’s unit price once a product is selected…

$lu = nuLookupRecord();

nuSetFormValue('ite_unit_price', $lu->pro_sell);

● ite_total​ - Set ​Formula​ to ​nuTotal('ite_unit_price') * nuTotal('ite_units')


● inv_total​ - Set ​Formula​ to ​nuTotal('invoice_item_sf.ite_total')
● Inv_tax​ - Set ​Formula​ to ​nuTotal('invoice_item_sf.ite_total') * .1
● Inv_grand_total​ - Set ​Formula​ to ​nuTotal('invoice_item_sf.ite_total') * 1.1

For more information on an Object’s properties refer to​ ​Objects​.

Page No.: 65
Create an Invoice Docket
Next we create a delivery docket that Itemises the customer, product and pricing information that can be run from the
Invoice Edit Form.

Build SQL

SELECT
customer.*,
invoice.inv_number,
invoice.inv_date,
invoice.inv_total,
invoice.inv_tax,
invoice.inv_grand_total,
invoice_item.*,
product.pro_description

FROM
customer
JOIN invoice ON customer.customer_id = invoice.inv_customer_id
JOIN invoice_item ON invoice.invoice_id = invoice_item.ite_invoice_id
JOIN product ON product.product_id = invoice_item.ite_product_id

WHERE
((invoice.invoice_id = '#RECORD_ID#'))

Page No.: 66
Create Fast Report

Edit Report

Rename ​Code ​and ​Description​.

Page No.: 67
Adjust Report Design from…

To…

To print this…

Page No.: 68
Add Action Buttons

We can add an Action Button to the Invoice Form that will Print the current docket.

This is done by adding Javascript to the invoice Form

We will add 2 Action Buttons to the invoice Edit Form.

● A Posted Button - This will set a flag (inv_posted) to 1. An invoice that is not posted will not see the Print
Button.
● The Print Button - .This will appear only when an invoice is posted.

if(nuFormType() == 'edit'){

if($('#inv_posted').val() == '1'){
nuAddActionButton('pinv', 'Print Docket', 'nuRunReport("INV")');
}else{
nuAddActionButton('ppost', 'Post Docket', '$("#inv_posted").val(1).change();nuSaveAction();');
}

Page No.: 69

You might also like