Skip to main content

Step 2 — The Customers screen

The customers table becomes a screen: a grid with filters, an edit dialog, add and delete. Three places in Settings, in this order: Connectors (the queries), Screens (the interface), Menus (the entry that opens it).


At a glance​

crm ▾📁 Sales👥 CustomersCustomers+ AddNAMEINDUSTRYCOUNTRYSTATUSE-MAILACME IndustriesManufacturingFRActivecontact@…Beta SARLLogisticsFRActiveventes@…Gamma SAServicesBEActivebonjour@…Edit · ACME IndustriesNameACME IndustriesStatusACTIVE ▾SaveThe crm apphas a menu nowMenu entrytype screenGenerated queriescustomers_get / _put / …Edit dialogaudit columns by the server

The queries​

  1. Liberty Next → Build → Connectors, select crm, choose Tables in the mode bar.
  2. + Add queries → Generate from DB, pick the customers table.
  3. Keep every column, tick key on ID, keep the four statements. Save.

The connector now holds customers_get, customers_post, customers_put and customers_delete. Two adjustments in the query editor:

  • customers_post — the database numbers the rows (SERIAL), so remove ID from the insert, and stamp the creation:
INSERT INTO customers (NAME, INDUSTRY, COUNTRY, STATUS, PRIMARY_EMAIL, CREATED_BY, CREATED_AT)
VALUES (:NAME, :INDUSTRY, :COUNTRY, :STATUS, :PRIMARY_EMAIL, {{LOGIN}}, {{SYSTIMESTAMP}})
  • customers_put — leave the creation columns alone and stamp the change:
UPDATE customers
SET NAME = :NAME, INDUSTRY = :INDUSTRY, COUNTRY = :COUNTRY, STATUS = :STATUS,
PRIMARY_EMAIL = :PRIMARY_EMAIL, UPDATED_BY = {{LOGIN}}, UPDATED_AT = {{SYSTIMESTAMP}}
WHERE ID = :ID_ORIGINAL

{{LOGIN}} and {{SYSTIMESTAMP}} are filled by the server — the user name and the current time — whatever the form sends. Save the connector page.

Each query has its own permission — sql:crm:customers_get, sql:crm:customers_put… — used in Step 5. Superusers have them all.


The screen​

  1. Liberty Next → Build → Screens → + Add scope, pick crm: the crm chip appears.
  2. + Add screen, id customers, then click the card to open the screen editor.
TabSetting
GeneralLabel Customers.
QueriesRead customers_get, update customers_put, insert customers_post, delete customers_delete.
ColumnsImport from read query, then: label each column, hide ID, CREATED_BY, CREATED_AT, UPDATED_BY (hidden), tick filter on STATUS, COUNTRY and INDUSTRY.
DialogOne tab Details with NAME, INDUSTRY, COUNTRY, STATUS, PRIMARY_EMAIL.

Save. The labels typed on the columns can later move to the dictionary, which serves every screen — see Step 3.


The menu​

  1. Liberty Next → Build → Menus → + Add scope, pick crm: the app's empty tree appears.
  2. + Folder: label Sales, icon briefcase.
  3. On the folder, + Add child: label Customers, type screen, target customers_get, icon users.
  4. Save.

crm now has a menu: it is an app, listed in the app picker at the top of the sidebar (with at least two apps). Its sidebar shows Sales → Customers.


See it work​

Open Customers: the grid shows ACME Industries, Beta SARL and Gamma SA.

  • Click a row: the dialog opens with the five fields; change one and Save — Updated by and Updated at are filled (show them from the Columns menu of the grid).
  • + Add opens an empty dialog for a new customer.
  • Delete in the dialog removes the row.

What you have now​

A Customers screen — list, filters, add, edit, delete — built from one table, with audit columns stamped by the server.

→ Step 3 — Deals and relationships: lists of values from the dictionary, deals linked to customers, activities in a tab.