Setting up fields - Part 2
Let Ninox do the work ...
To automate tasks, we store information in certain fields to assist us.
How it works
- Go to the subtable Invoice Items.
- Enable edit mode
We go through the (white) fields one by one:
- Description
- Unit Price
- Total
- Associated Invoice Number
Description
- Click on the field Description.
- Click on the wrench icon in the red-marked field to open the Field Settings.
- Click on the Formula field to open the Formula Editor.
- The Description of the consumed item is retrieved from the Food & Drinks table. Open the submenu of
Food & Drinks by clicking the arrow
and select Description.
Clicking on the field and then on the wrench icon (1) + (2) will open the field settings.
This is what the field settings look like after inserting the script.
Alternative: You can also write directly in the Formula Editor. As you type, the Formula Editor will provide suggestions. Try it out!
Unit Price
The unit price is also retrieved from the Food & Drinks table. Follow the same steps as above:
- Click on the field Unit Price.
- Click on the wrench icon in the field to open the Field Settings.
- Click on the Formula Field to open the Formula Editor.
- Open the submenu of Food & Drinks by clicking the arrow and select Unit Price.
Don't forget to also adjust the number format in the field settings.
Analogue to the previous field, get the corresponding information from the ‘Food & drink’ table
Total
Here, we insert a calculation in the formula field. The process remains the same:
- Click on the field Total.
- Click on the wrench icon in the field to open the Field Settings.
- Click on the Formula Field to open the Formula Editor.
- Select Quantity, insert an asterisk (*) for multiplication, followed by Unit Price.
Don't forget to also adjust the number format in the field settings.
Here we have inserted a calculation that calculates the total amount
You can find out more about arithmetic operators under Introduction to Ninox Script here in our documentation.
Associated Invoice Number
The corresponding invoice number is retrieved from the Invoices table. The procedure is the same:
- Click on the field Invoice No..
- Click on the wrench icon in the field to open the Field Settings.
- Click on the Formula Field to open the Formula Editor.
- Open the submenu of Invoices by clicking the arrow and select Invoice Number.
We retrieve the invoice number for each item based on the invoice where the item appears.
Now, in the top right, save all changes!
Reply
Content aside
- 22 hrs agoLast active
- 4Views
-
1
Following