Build Your First Screen

This tutorial builds a complete, working IFS Cloud screen from scratch. By the end you will have written a projection file, a fragment, and a client file that together produce a navigable list page with a detail form, a LOV dropdown, a badge, and a command button.

Prerequisites

Read Thinking in Marble first. This tutorial assumes you understand the four-layer stack and the three rules. If a term is unfamiliar, check the Glossary.


What You’ll Build

A Leave Request tracker β€” a screen where employees can view and submit leave requests, and managers can see all requests in a list.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Leave Requests                              [+ New]     β”‚
│─────────────────────────────────────────────────────────│
β”‚  Request ID  β”‚ Employee  β”‚ Type    β”‚ Start    β”‚ Status   β”‚
β”‚  LR-00001    β”‚ Smith, J  β”‚ Vacationβ”‚ 2024-06-01β”‚ ● Open  β”‚
β”‚  LR-00002    β”‚ Jones, A  β”‚ Sick    β”‚ 2024-06-03β”‚ ● Open  β”‚
β”‚  LR-00003    β”‚ Davis, M  β”‚ Vacationβ”‚ 2024-05-20β”‚ βœ“ Closedβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 
Clicking a row opens the detail form:
 
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Leave Request: LR-00001                  ● Open        β”‚
│─────────────────────────────────────────────────────────│
β”‚  Request ID   LR-00001    Company    10               β”‚
β”‚  Employee     [Smith, John          β–Ό]  John Smith      β”‚
β”‚  Leave Type   Vacation                                  β”‚
β”‚  Start Date   2024-06-01                               β”‚
β”‚  End Date     2024-06-10                               β”‚
β”‚  Reason       ________________________________          β”‚
β”‚               [Submit Request]                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

You will build this in ten steps. Each step shows exactly what to add and why.


The Files You’ll Create

FileTypePurpose
LeaveRequest.projectionProjectionData contract: entity, entityset, reference, action
EmployeeSelector.fragmentFragmentReusable employee LOV (projection + client sides)
LeaveRequest.clientClientUI: list page, form page, navigator entry, command

In a real project, the selector fragment likely already exists β€” you would just include it. Here you’ll write it yourself to understand what’s inside.


Step 1: Create the Projection File

Every screen starts with the projection. Create LeaveRequest.projection.

The file always opens with the same five header lines:

component MYCOMP;             -- the IFS component this belongs to
layer Cust;                   -- Cust = customization layer (your code)
projection LeaveRequestHandling;  -- name used by client files
 
include fragment EmployeeSelector;   -- we'll write this in Step 3

layer Cust

Using layer Cust marks this as your customization code. IFS upgrades won’t overwrite it. layer Core is reserved for IFS-supplied base code β€” never use it for your own files.


Step 2: Define the Entity

The entity declares the data shape. Add this to your projection file:

entity LeaveRequest {
   crud = Read, Create, Update, Delete;
 
   attribute RequestId      Text {
      label = "Request ID";
   }
   attribute Company        Text {
      label = "Company";
   }
   attribute EmployeeId     Text {
      label = "Employee";
   }
   attribute LeaveType      Text {
      label = "Leave Type";
   }
   attribute StartDate      Date {
      label = "Start Date";
   }
   attribute EndDate        Date {
      label = "End Date";
   }
   attribute Reason         LongText {
      label = "Reason";
      editable = [true];
   }
   attribute Objstate       Text {
      label = "Status";
      editable = [false];
   }
   attribute ObjstateDbVal  Text;   -- needed for state machine operations
 
   reference EmployeeRef(Company, EmployeeId) to Employee(Company, EmployeeId);
 
   keys CompanyKey = Company, RequestIdKey = RequestId;
}

What each part does:

  • crud = Read, Create, Update, Delete β€” enables all four operations on the list and form
  • Each attribute line declares one column. The name, type, and label are all you need to start.
  • editable = [false] on Objstate β€” the status is controlled by actions, not direct editing
  • reference EmployeeRef(...) β€” declares the foreign key that the employee LOV will use
  • keys β€” tells the framework which attributes uniquely identify one record

Types at a Glance

Text = VARCHAR, Number = numeric, Date = date only, Timestamp = date+time, Boolean = yes/no, LongText = multi-line text (CLOB equivalent).


Step 3: Expose the Entity with an Entityset

The entity defines the data shape. The entityset makes it queryable by a client page. Add this directly below the entity:

entityset LeaveRequestSet for LeaveRequest;

One line. Every page that wants to show LeaveRequest data will declare using LeaveRequestSet.

Entityset vs Entity

The entity is the blueprint. The entityset is the public endpoint. A page binds to the entityset; the entityset resolves to the entity. You can have multiple entitysets for one entity with different filters or ordering β€” but one is enough to start.


Step 4: Declare the Action

Add the action that submits a request. When the user clicks β€œSubmit Request,” this is what runs on the server:

action SubmitLeaveRequest {
   initialcheck none;
   parameter RequestId  Text;
   parameter Company    Text;
 
   supportwarnings = [true];
}
  • initialcheck none β€” skips the framework’s default pre-save check (appropriate for workflow actions)
  • parameter lines β€” the data the client must pass when calling this action
  • supportwarnings = [true] β€” allows the PL/SQL implementation to return warnings the user can override

You Don't Write the PL/SQL Here

The action declaration is the contract. The PL/SQL implementation goes in the .plsvc file (same name as the projection). Writing that file is outside this tutorial’s scope β€” here you’re defining what the client can call.


Step 5: Write the Employee Selector Fragment

This fragment provides the employee LOV. Create EmployeeSelector.fragment.

A fragment always has two sections β€” projection side first, then client side:

component MYCOMP;
layer Cust;
 
----------------------------- PROJECTION FRAGMENTS ----------------------------
 
-- Exposes a read-only employee list for LOV lookups:
query EmployeeSelector for Employee {
   where = "OBJSTATE_DB = 'Active'";   -- only active employees
}
 
entityset EmployeeSelectorSet for EmployeeSelector;
 
------------------------------ CLIENT FRAGMENTS --------------------------------
 
-- The selector UI component β€” this is what `with ReferenceEmployeeSelector` refers to:
selector ReferenceEmployeeSelector for EmployeeSelectorSet {
   static EmployeeId;          -- the "code" column shown in the LOV field
   static Name;                -- the description shown next to the code
   static Company;
}

Why two sections? The fragment must satisfy both sides of the contract at once. When the client includes this fragment, it gets the entityset (data) AND the selector component (UI) in one file. See Fragment for the full explanation.

Naming Convention

The selector is named ReferenceEmployeeSelector β€” the Reference prefix is the IFS convention for LOV selectors. This name is what the client uses in lov EmployeeRef with ReferenceEmployeeSelector.


Step 6: Create the Client File

Create LeaveRequest.client. The header declares which projection it consumes and which fragments it needs:

component MYCOMP;
layer Cust;
client LeaveRequest;
projection LeaveRequestHandling;
 
include fragment EmployeeSelector;   -- makes ReferenceEmployeeSelector available

client and projection Names Must Match

The name after client and after projection must be identical. They’re the binding key β€” the framework uses this to link the two files. A mismatch causes a build error.


Step 7: Build the List Page

Add the list and its page to the client file:

----------------------------------- LISTS -------------------------------------
 
list LeaveRequestList for LeaveRequest {
   orderby = StartDate desc;        -- newest requests first
   editmode = SingleCellEdit;
   multiselect = [true];
 
   fieldranking RequestId, EmployeeId, LeaveType, StartDate, Objstate;
 
   field RequestId {
      size = Small;
   }
   field StartDate {
      size = Small;
   }
   field EndDate {
      size = Small;
   }
 
   -- LOV column: shows EmployeeId code + name description
   lov EmployeeRef with ReferenceEmployeeSelector {
      label = "Employee";
      size  = Medium;
      description = EmployeeRef.Name;
   }
 
   field LeaveType {
      size = Medium;
   }
 
   -- Badge: status chip colored by Objstate value
   badge Objstate {
      label = "Status";
      emphasis StateOpen      = [Objstate = "Open"];
      emphasis StateReleased  = [Objstate = "Submitted"];
      emphasis StateCompleted = [Objstate = "Approved"];
      emphasis StateClosed    = [Objstate = "Closed"];
      emphasis StateCancelled = [Objstate = "Rejected"];
   }
 
   -- Command: appears as an action button on selected rows
   command SubmitRequestCommand;
}
 
----------------------------------- PAGES -------------------------------------
 
page List using LeaveRequestSet {
   label = "Leave Requests";
   startupmode = search;         -- wait for user to search before loading data
   list LeaveRequestList;
}

startupmode = search

Always use startupmode = search on list pages for entities that could have many records. The page opens with an empty grid and a search bar β€” data only loads after the user applies a filter. Without it, the page tries to load every record on open.


Step 8: Build the Detail Form

Add the group and form page. This is what the user sees after clicking a row:

---------------------------------- GROUPS -------------------------------------
 
group LeaveRequestGroup for LeaveRequest {
   label = "";    -- no panel header; the page title serves as context
 
   field RequestId {
      size = Small;
      editable = [false];
   }
   field Company {
      size = Small;
      editable = [false];
   }
 
   lov EmployeeRef with ReferenceEmployeeSelector {
      label       = "Employee";
      size        = Medium;
      description = EmployeeRef.Name;
      editable    = [Objstate = "Open"];   -- lock after submission
   }
 
   field LeaveType {
      size     = Medium;
      editable = [Objstate = "Open"];
   }
   field StartDate {
      size     = Small;
      editable = [Objstate = "Open"];
   }
   field EndDate {
      size     = Small;
      editable = [Objstate = "Open"];
   }
   field Reason {
      size      = FullWidth;
      multiline = true;
      editable  = [Objstate = "Open"];
   }
}
 
-- The form page: shows the group for one selected record
page Form using LeaveRequestSet {
   label = "Leave Request";
   group LeaveRequestGroup;
}

editable = [Objstate = "Open"]

This pattern β€” locking all fields once a request is no longer Open β€” is the standard IFS form approach. The user can only edit fields while the record is in its initial state. After submission, the form becomes read-only automatically.


Step 9: Declare the Command

The command wires the client button to the server action. Add this to the client file, before the lists section:

--------------------------------- COMMANDS ------------------------------------
 
command SubmitRequestCommand for LeaveRequest {
   label   = "Submit Request";
   mode    = SelectedRecords;
   enabled = [Objstate = "Open"];   -- only enabled on Open requests
 
   bulkexecute {
      call SubmitLeaveRequest(RequestId, Company);
   }
}
  • mode = SelectedRecords β€” the command appears when one or more rows are selected
  • enabled = [Objstate = "Open"] β€” grays out the button for already-submitted requests
  • bulkexecute β€” runs once per selected row; calls the action declared in the projection

bulkexecute vs execute

Use bulkexecute + bulknavigate/call when the command operates on multiple selected rows. Use execute when the command operates on a single record (e.g., from a form page). For commands triggered from a list, bulkexecute is almost always correct.


Step 10: Add the Navigator Entry

Without a navigator entry, the page can only be reached by URL. Add this to register it in the IFS application menu:

--------------------------------- NAVIGATOR -----------------------------------
 
navigator {
   entry LeaveRequestNavEntry parent HrNavigator.LeaveManagementEntry at index 500 {
      label = "Leave Requests";
      page  List;
   }
}
  • parent HrNavigator.LeaveManagementEntry β€” places this under an existing menu group
  • at index 500 β€” controls its sort position within that group (higher index = lower in menu)
  • page List β€” the page to open when the user clicks the menu entry

Parent Navigator Groups

HrNavigator.LeaveManagementEntry is a fictional parent used for this tutorial. In a real project, find the correct parent by looking at neighboring features in the same module. The Navigator.md reference covers the full syntax.


The Complete Files

Here are the three final files as they stand after all ten steps.

LeaveRequest.projection

component MYCOMP;
layer Cust;
projection LeaveRequestHandling;
 
include fragment EmployeeSelector;
 
entity LeaveRequest {
   crud = Read, Create, Update, Delete;
 
   attribute RequestId      Text {
      label = "Request ID";
   }
   attribute Company        Text {
      label = "Company";
   }
   attribute EmployeeId     Text {
      label = "Employee";
   }
   attribute LeaveType      Text {
      label = "Leave Type";
   }
   attribute StartDate      Date {
      label = "Start Date";
   }
   attribute EndDate        Date {
      label = "End Date";
   }
   attribute Reason         LongText {
      label = "Reason";
      editable = [true];
   }
   attribute Objstate       Text {
      label = "Status";
      editable = [false];
   }
   attribute ObjstateDbVal  Text;
 
   reference EmployeeRef(Company, EmployeeId) to Employee(Company, EmployeeId);
 
   keys CompanyKey = Company, RequestIdKey = RequestId;
}
 
entityset LeaveRequestSet for LeaveRequest;
 
action SubmitLeaveRequest {
   initialcheck none;
   parameter RequestId  Text;
   parameter Company    Text;
   supportwarnings = [true];
}

EmployeeSelector.fragment

component MYCOMP;
layer Cust;
 
----------------------------- PROJECTION FRAGMENTS ----------------------------
 
query EmployeeSelector for Employee {
   where = "OBJSTATE_DB = 'Active'";
}
 
entityset EmployeeSelectorSet for EmployeeSelector;
 
------------------------------ CLIENT FRAGMENTS --------------------------------
 
selector ReferenceEmployeeSelector for EmployeeSelectorSet {
   static EmployeeId;
   static Name;
   static Company;
}

LeaveRequest.client

component MYCOMP;
layer Cust;
client LeaveRequestHandling;
projection LeaveRequestHandling;
 
include fragment EmployeeSelector;
 
--------------------------------- COMMANDS ------------------------------------
 
command SubmitRequestCommand for LeaveRequest {
   label   = "Submit Request";
   mode    = SelectedRecords;
   enabled = [Objstate = "Open"];
   bulkexecute {
      call SubmitLeaveRequest(RequestId, Company);
   }
}
 
----------------------------------- LISTS -------------------------------------
 
list LeaveRequestList for LeaveRequest {
   orderby = StartDate desc;
   editmode = SingleCellEdit;
   multiselect = [true];
   fieldranking RequestId, EmployeeId, LeaveType, StartDate, Objstate;
 
   field RequestId {
      size = Small;
   }
   field StartDate {
      size = Small;
   }
   field EndDate {
      size = Small;
   }
   lov EmployeeRef with ReferenceEmployeeSelector {
      label = "Employee";
      size  = Medium;
      description = EmployeeRef.Name;
   }
   field LeaveType {
      size = Medium;
   }
   badge Objstate {
      label = "Status";
      emphasis StateOpen      = [Objstate = "Open"];
      emphasis StateReleased  = [Objstate = "Submitted"];
      emphasis StateCompleted = [Objstate = "Approved"];
      emphasis StateClosed    = [Objstate = "Closed"];
      emphasis StateCancelled = [Objstate = "Rejected"];
   }
   command SubmitRequestCommand;
}
 
---------------------------------- GROUPS -------------------------------------
 
group LeaveRequestGroup for LeaveRequest {
   label = "";
   field RequestId {
      size = Small;
      editable = [false];
   }
   field Company {
      size = Small;
      editable = [false];
   }
   lov EmployeeRef with ReferenceEmployeeSelector {
      label       = "Employee";
      size        = Medium;
      description = EmployeeRef.Name;
      editable    = [Objstate = "Open"];
   }
   field LeaveType {
      size = Medium;
      editable = [Objstate = "Open"];
   }
   field StartDate {
      size = Small;
      editable = [Objstate = "Open"];
   }
   field EndDate {
      size = Small;
      editable = [Objstate = "Open"];
   }
   field Reason {
      size = FullWidth;
      multiline = true;
      editable = [Objstate = "Open"];
   }
}
 
----------------------------------- PAGES -------------------------------------
 
page List using LeaveRequestSet {
   label = "Leave Requests";
   startupmode = search;
   list LeaveRequestList;
}
 
page Form using LeaveRequestSet {
   label = "Leave Request";
   group LeaveRequestGroup;
}
 
--------------------------------- NAVIGATOR -----------------------------------
 
navigator {
   entry LeaveRequestNavEntry parent HrNavigator.LeaveManagementEntry at index 500 {
      label = "Leave Requests";
      page  List;
   }
}

What You’ve Covered

ConceptWhere it appeared
Projection file structureStep 1
Entity with attributes and typesStep 2
EntitysetStep 3
Action declarationStep 4
Fragment (both sections)Step 5
Client file header + include fragmentStep 6
List with orderby, editmode, fieldrankingStep 7
lov with descriptionStep 7, Step 8
badge with emphasisStep 7
Group with conditional editableStep 8
command with bulkexecute and callStep 9
Navigator entryStep 10

What’s Not Covered Here

This tutorial builds the most common screen pattern. These topics go deeper:

TopicReference
Validate commands (onChange recalculation)Fields and LOV
Dialog for data entryDialog + Virtual
Multi-step assistant wizardAssistant + Virtual
Master-detail with nested listsList β†’ Bind section
Charts and calendar viewsCharts, Data Views
Search context (advanced filtering)Selector and Search Context
State machine and Objstate transitionsEntity β†’ Objstate section
Layer override on existing screensProjection File Structure β†’ Override section

Common First-Screen Errors

include fragment is missing

If the LOV dropdown is empty or the build fails with an unknown selector error, you’ve forgotten include fragment EmployeeSelector; in either the projection file or the client file β€” it must be in both.

client and projection names don't match

client LeaveRequestHandling; and projection LeaveRequestHandling; must be identical. A mismatch means the framework can’t link the files and the screen won’t build.

Page loads all records on open

You forgot startupmode = search; on the list page. Add it to any page bound to a high-volume entity.

Command is always grayed out

The enabled = [Objstate = "Open"] expression evaluates against the selected record. If you’re testing with a record that’s already in β€œSubmitted” state, the button is correctly disabled. Try with an β€œOpen” record.