Building the "Order Management" Training App : Creating virtual links
Prerequisite : The Supplier, Product, Client and Order objects are linked together
What is a Virtual link ?
In Simplicité, a virtual link allows you to access data between business objects without adding a physical column or foreign key. The data is retrieved via an SQL query configured on the virtual link, enabling flexible relationships without altering the database structure... Learn more
Accessing the list of a Supplier's Clients
To create a virtual link between the TrnSupplier and TrnClient objects, follow the steps below :
Create and add a non persistent Field to TrnClient
- Open TrnClient's template editor
For a detailed step-by-step, see Getting started : Create field
- Add a new Internal ID field
- Fill in the Field's information like so :
- Label : Supplier Virtual Id
- Logical name : trnCliSupplierVirtualId
- Physical name : empty
- Updatable : Read only
- Visible : Invisible
- Click Save
- Close the Template editor, click Close
- In the Object Fields panel linked to the Business object, open trnCliSupplierVirtualId
Be sure to open the ObjectField and not the Field
- In the Joined object field, type "TrnSupplier" and select the element suggested
- Click Save
- Fill in the Deletion mandatory field : Do not use
- Click Save & Close
Add an SQL filter to the Virtual link
- In the Business objects > Links menu, open the previously created link
- Fill in the Link's information like so :
- SQL specification :
t.row_id IN (
SELECT c.row_id
FROM trn_client c
JOIN trn_order o ON o.trn_ord_cli_id = c.row_id
JOIN trn_product p ON o.trn_ord_prd_id = p.row_id
JOIN trn_supplier s ON p.trn_prd_sup_id = s.row_id
WHERE s.row_id = [row_id]
)
t
is the alias of the child (Client) table
[row_id]
is the parent (Supplier) record's ROWID
- Click Save
Add a label to the Virtual link
- In the Object link translation panel linked to the Link, click Create
- Fill in the Translation's fields like so :
- Language : English
- Translation : Supplier's customers
- Click Save & Close
Test the Virtual link with the usertest User
- Clear the platform's cache and log in using usertest
For a detailed step-by-step, see : Testing the User
- Open a Supplier
The "Supplier's customers" panel is visible and contains the list of clients that have ordered a Product from the Supplier
