Step 3 — Deals and relationships
Three things in this step:
- The dictionary: labels shared by every screen, and lists of values instead of free text.
- The Deals screen, where each deal picks its customer and its stage from a list.
- The deal's activities, in a tab of the deal dialog.
At a glance
The dictionary
Entries from the tables
Liberty Next → Build → Dictionary, pick the crm scope, then Scan a table:
- Connector
crm, tablecustomers, Scan: one proposal per column, missing ones ticked. - Fill the Label of each (
Name,Industry,Country,Status,E-mail…), then Add. - Same for
dealsandactivities.
Every screen of the app now shows these labels — the labels typed on the Customers columns in Step 2 can be cleared.
The customer status — an enum
Enums tab, + Add enum CUSTOMER_STATUS, with the values ACTIVE (Active), PROSPECT (Prospect), INACTIVE (Inactive). Then on the STATUS entry: Rules ENUM, Rules values CUSTOMER_STATUS.
The grid shows Active instead of ACTIVE, and the dialog offers the three values.
The customer of a deal — a lookup
A lookup turns a code (the customer's id) into a label (its name), from a query.
- Liberty Next → Build → Connectors → crm → Lookups → + Add lookup: table
customers, value columnID, label columnNAME. The assistant writes the query and the dictionary lookupcustomers. - Same for the stages: table
deal_stages, valueCODE, labelLABEL. - In the dictionary, entry
CUSTOMER_ID: RulesLOOKUP, Rules valuescustomers; entrySTAGE: RulesLOOKUP, Rules valuesdeal_stages.
Save the dictionary. See Dictionary and Sequences and lookups.
The Deals screen
- Connectors → crm → Tables → + Add queries → Generate from DB, table
deals, keyID. As in Step 2, removeIDfromdeals_post, and addUPDATED_AT = {{SYSTIMESTAMP}}todeals_put. - Screens, chip
crm, + Add screendeals: labelDeals, the four queries, Import from read query in Columns, a dialog tabDealwithCUSTOMER_ID,NAME,STAGE,AMOUNT,CLOSE_DATE,OWNER. - Menus, under Sales: an entry
Deals, typescreen, targetdeals_get, icontrendingup.
The grid shows the customer's name and the stage's label; the dialog offers both as searchable lists. Tick filter on STAGE and CUSTOMER_ID to filter the grid by them.
Activities in a tab
The activities of a deal show in its dialog, as a grid of their own.
The Activities screen
- Generate from DB on
activities, keyID. Inactivities_post, removeIDand stamp who recorded it:
INSERT INTO activities (DEAL_ID, KIND, NOTES, HAPPENED_AT, RECORDED_BY)
VALUES (:DEAL_ID, :KIND, :NOTES, :HAPPENED_AT, {{LOGIN}})
- A screen
activitieson these queries, with a dialog holdingKIND,NOTES,HAPPENED_AT. Its read query needs the deal's id — addWHERE DEAL_ID = :DEAL_IDtoactivities_get.
The tab
In the deals screen, Dialog tab, + Add tab, then in Tab settings:
| Setting | Value |
|---|---|
| Tab label | Activities |
| Tab type | Nested table |
| Target screen | activities |
| Parameter bindings | parent column ID → nested param DEAL_ID |
The tab shows the activities of the open deal; + Add in it creates an activity with DEAL_ID already filled. Set hide_on_add on the tab: a deal being created has no id yet. See Nested tabs.
See it work
- Customers: the status shows as a label and is picked from a list.
- Deals: four deals, with their customer and stage; filter on Negotiation.
- Open Logistics platform, tab Activities, + Add: record a call. Recorded by holds your user name.
What you have now
Two related screens, labels and lists of values shared through the dictionary, and child rows inside a dialog.
→ Step 4 — Dashboard: the pipeline at a glance.