OutSystems-Developer-Cheat-Sheet
OutSystems-Developer-Cheat-Sheet
OutSystems Developer Cheat Sheet ○ In[Logic] Layer , right-click either the[Client ● APrimary Keyof anEntity:
Actions]or[Server Actions] folder, and“Add ○ UnderEntity Identifiers, select the Entity Identifier
Client/Server Action” ● AStructurethe same as theAttributes (row) of an Entity:
Service Studio IDE 1. OR withScreen scope: ○ UnderEntities, select the Entity
○ In[Interface] Layer Elements Tab (7), right-click the ● AnexistingStructure, defined under the[Data] Layer :
creen , “Add Client Action”
S ○ UnderStructures, select the Structure
.An orange ballfor the Action will be created: Hollow orange
2 Define calculations with Operators/Operands/Functions in
an Action
for client-side (compiles to Javascript) and solid orange
for server-side (compiles to .NET). NOTE: This default
● In a conditional: UsingIf logic widget
icon can be changed from the properties panel (8).
○ In the properties panel (8) after selecting theIfwidget,
3.Right-clickon the newly created Client or Server double-click on theConditionproperty row to bring up
Action to add anyInput/Output ParametersorLocal theExpression Editorand type your expression in the
Variables Expression field using operands and operators, as well as
4.Double-Clickon the newly created Client or Server variables, functions, and scripts in scope as seen in the
Action to define the logic, by dragging/dropping Logic Scope pane (bottom left of Expression Editor)
widgets from the Toolbox (2) into the flow and setting their
properties (8) ● In an assignment: UsingAssign logic widget
5.NOTE: To make the Action also accessible in anexpression ○ In the properties panel (8) after selecting theAssign
( 1) 1-Click PublishButton - Compile and Run as a Function, set the Action’s “Function” property to “Yes” widget, select aVariableto assign the expression to, then
(2) Toolbox- Elements to drag onto Canvas Define Variables double-click on theValueproperty row to bring up the
(3) Canvasto design Processes/UI/Logic/Data Model ● WithMethod scope: Expression Editorand type your expression in the
(4) Widget Breadcrumb- Navigate through UI hierarchy Expression field using operands and operators, as well as
○ Right-click on theAction , “Add Local Variable”, variables, functions, and scripts in scope as seen in the
(5) Element Breadcrumb- Navigate through Elements and set its Data Type in the properties panel (8)
(6) LayersTab- Processes, Interface, Logic, Data Scope pane (bottom left of Expression Editor)
WithScreen scope:
● Define For Each and While loops in an Action
(7) Elementsfor selected Layer - Some elements can be
dragged onto Canvas;Widget TreeTab (Interface Layer ○ In[Interface] Layer Elements Tab (7), right-click the
only) to navigate hierarchy of UI Elements creen , “Add Local Variable”, and set its Data Type in
S ● For Each logic widget
(8) Propertiesfor selected Element(s);StylesTab the Properties panel (8) 1. In the properties panel (8) after selecting theFor Each
(Interface Layer only) for selected UI Elements WithSession scope(Cleared on End User log-off or
● widget, fill in theRecord Listproperty, and optionally the
(9) True ChangeandDebuggerTabs timeout) Start Index and Maximum Iterations properties.
2.Drag your mouse from theFor Eachwidget (cursor will
Define custom data structures ○ In[Data] Layer , right-click the[Client Variables]
folder, “Add Client Variable”, and set its Data Type in the t urn into crosshairs ) to drag out theCyclebranch to
1. In[Data] Layer , right-click the[Structures] folder, and properties panel (8) define the 1 or more logic widgets that will execute in this
“Add Structure” WithModule scope:
● loop.
2.Right-click on the newly created Structure, select “Add 3.Complete the loop by dragging from the last logic
○ In[Data] Layer , right-click the[Site Properties] element back to the If widget.
Attributes”, and set its properties (i.e. Data Type) in the
folder, “Add Site Property”, and set its Data Type in the 4.NOTE: You can create logic to exit the loop early by
properties panel (8).
properties panel (8) placing anIfwidget within the flow for the exit condition.
Create a Screen
Define Variables beyond Basic Data Types
● Method 1: In[Interface] Layer Elements Tab (7), In theData Typeproperty of the Variable, to define a Variable ● While: UsingIf logic widget
right-click the[MainFlow] UI Flow, and“Add Screen” of: 1. In the properties panel (8) after selecting theIfwidget, fill
● AnArray/List: in theConditionproperty.
● Method 2: In[Interface] Layer Elements Tab (7), ○ UnderOther, selectList…then select the List type 2.Drag your mouse from theIfwidget (cursor will turn into
double-click the[MainFlow] UI Flow,and drag a “Screen” ● A temporaryStructure:
widget from the Toolbox (2) ○ UnderOther, selectRecord…then right-click on the rosshairs
c ) to drag out theTruebranch to define the
Define a reusable Method (OutSystems term: “Action”) Variable and select “Add Attribute” to add other 1 or more logic widgets that will execute in this loop as
1. WithModule scope: Attributes of the Record/Structure as necessary, defining long as the If Condition property is true.