Create Server Data Store
Key Lesson: In this step, you learn how to create a **Server Data Store** and configure which Entities are persisted to the application database.
Create a Server Data Store for the Purchasing app and add PurchaseRequest and PurchaseRequestItem from Build the Minimum Data Model.
1. Create the Server Data Store
Section titled “1. Create the Server Data Store”- Go to Design.
- Select ServerDataStore under Object Types.
- Click +.
- Enter PurchaseDB and click OK.
When the editor opens, leave the following GENERAL settings at their default values:
| Setting | Value |
|---|---|
| STORE TYPE | DataBase |
| USE SYSTEM DATABASE | Enabled (default) |
| DATABASE SCHEMA NAME | solution |
| CREATE DB TABLES FOR STATIC ENTITIES | Disabled (default) |
2. Add the Entities
Section titled “2. Add the Entities”Under Entity configurations, use SELECT ENTITIES to select the two Purchase Request Entities:
| Entity | Selection |
|---|---|
| Purchasing.PurchaseRequest | Selected |
| Purchasing.PurchaseRequestItem | Selected |
Note
After an Entity is selected, it appears under CONFIGURATION. Except for the currency precision setting in the next section, leave the Entity configuration settings at their default values for this tutorial.
3. Configure currency precision
Section titled “3. Configure currency precision”Under CONFIGURATION, set Precision to 2 for the persisted budget amount:
| Entity property | Precision |
|---|---|
| Purchasing.PurchaseRequestItem.budgetAmount | 2 |
Leave the remaining Entity configuration settings at their default values for this tutorial.
Save and close the editor.