Below are some script examples you can apply to the program to better understand its various functions.
These templates are designed to meet a wide range of needs; try them and adapt them in your own databases.
If you need help or a script you can’t find, feel free to contact us at this link.
To see how to create a new script, see the guide on this page.
To try the scripts, copy the lines in the grey boxes into the LUA editor.
The boxes follow the order you also need to follow to try them.
Create a cost history for items
We create a table to keep a history of all the cost changes of our items.
Use a barcode reader in a document
We intercept a barcode reading to add our items to a document automatically.
Update the customer name in documents
We automatically update the customer name in all the documents where it is used.
Create an invoice from appointments
We create an invoice grouping all the work appointments carried out at a customer’s site.
Check our GPS position
Let’s see how to read our GPS position from the phone to check the data entered by our operators.
Create monthly summaries from operators’ timesheets
We create, directly in the database, a document that collects the hours worked by our staff each month.
Import an XML file
We import an XML file to load data into our database.
Export to an XML file
We export an invoice to an XML file.
Block saving an order
Using error handling, we prevent an order from being saved if the customer is insolvent.
Update bill of materials prices
Let’s see how to update item prices starting from the bill of materials.
Update the bank account from the payment due date to the invoice
Starting from a payment due date, we change the bank account and update the linked invoice.
Group a customer’s orders into one invoice
We collect the orders placed by a customer and create a single invoice.
Change the currency of all fields
We use this script to change all currency fields at once, replacing the currency symbol.
Create a script report
We create a script report to see how to handle the main creation steps (Windows only).
Print several orders together
We use a script to create a single printout made of several order printouts.
Create customers from a list of service reports
In this example we create the customer records referenced in technical service reports. This is very handy when the reports are loaded from an Excel file.
Empty a table completely
In this example we create a very simple script that deletes all the data in a specific table.
Use the Nios4 web API directly from LUA
In this example we connect two separate databases belonging to the same user, so they can exchange data (article in Italian).
Send an email directly from scripts
An example of sending an email when a record is saved (article in Italian).
Create a notification directly from scripts
In this example we see how to create and manage a notification (article in Italian).
Read and write an additional table
In this example we see how to read and write the data of an additional table on the data form
