Third-party tables
SuperOffice Expander Tools license gives you the possibility to create extra tables in the database. Instantly, these third-party tables will be available for standard CRUD operations in SuperOffice Service. You need to set up a web panel to access them from the Sales client.
However, an empty table is not very useful. So you have to set up fields for the new table and then you can populate with data.
Note
This feature requires a Development Tools license. This is an additional cost per site.
The Tables screen in System design
The Tables screen is your tool for customizing the database schema. Here you will find a list of the tables in the system:
- standard tables: predefined by SuperOffice and forms the basis of different screens
- extra tables: created by you or other 3rd parties with optional content
To open:
- Sign in to SuperOffice Service.
- Click the hamburger menu and select System Design. Then select Tables.
Conventions
Caution
Choose your database table and field names carefully. They cannot be changed later!
A logical name is best because it makes it easier to see what the database contains.
The prefixes ensure that what you create don't conflict with future SuperOffice table and field names. However, it doesn't guarantee a lack of naming conflicts between different 3rd parties.
Table names
- must start with y_
- may contain only underscores, the letters a to z, and numbers
Field names
- must start with x_
- must be unique within the table
- must be a single word
- may contain only underscores, letters from a to z, or numbers
Creating an extra table
Note
This task is done in the Tables screen of SuperOffice Service.
- Open the Tables screen.
- Click New table.
- Set table properties:
- Enter a name to be used as the label.
- Enter a database field beginning with y_ to identify it in the schema.
- Optionally set other properties.
- Click OK to save the new table (runs
create table y_mynewtable ...
). - Add fields to your new table. (See next task for details.)
- Optionally adjust table properties such as sort order.
- Click the table link to get to the Edit table screen
- Click Restart NetServer.
Tip
Some table properties can't be set until you've added fields. Click the table name in the list to enter edit mode.
You can now open the table in the UI to add content to it or populate it via the APIs.
Add fields to the new table
- In the Tables screen, hover the table you want to alter and click New field.
- Select a type for the new field and click OK.
- Set field properties:
- Enter a name to be used as the label.
- Enter a database table beginning with x_ to identify it in the schema.
- Optionally set other properties. The type determines what's available.
- Click OK to save the new field (runs
alter table y_mynewtable add column x_mynewfield ...
). - Continue adding more fields. Click Restart NetServer when you're done.
Tip
To make a field mandatory, select Cannot be empty.
Add data to the new table
- In Service, click Requests and then click Tables.
- Hover the table you want to add data to and click New entry.
- Fill in the data for the new row and click OK.