Substitution formulas
Substitution formulas are functions which are calculated at runtime and return a text string.
Substitution formulas can be used in specific Objects properties throughout the Capsules environment on in specific Procedure steps. For example, they can be used in the Caption field of a Label object or in definition of a the Data model security profile or when customizing the printing layout of a Screen.
Substitution Formulas Library
All Substitution formulas are case insensitive, except @[entityname].
Formula syntax |
Result |
Output example (with culture EN-US) |
@user |
Returns the user name of the currently logged user. |
Susan Mayer |
@username |
Synonym of @user |
Susan Mayer |
@capsule |
Returns the current Capsule name |
Budget 2010 |
@screen |
Returns the current Screen name |
Forecast |
@database |
Returns the name of the current Data model |
Delta |
@DTB |
Synonym of @database |
Delta |
@selection |
Returns the current Selection in the form of the name of the Entities on which a selection was made, followed by a comma separated list of selected members. @Selection in data block headers will show block references too. Please refer to section below for more details |
Year: 2004, 2005 |
@[entityname] |
Returns the list of selected (in the Select or Pager Object) members of the specified Entity. Note that the entity name is case sensitive. |
24 / 60 |
@time |
The string returned by the @time function is culture-sensitive and shows the current time when a Screen is opened. |
7:55:30 AM |
@time12 |
Returns the current time in format "HH:mm". The function is culture-sensitive. |
07:55 |
@time24 |
Returns the current time in format "HH:mm tt". The function is culture-sensitive. |
07:55 AM |
@timelong |
Returns the current time in format ""HH:mm:ss". The function is not culture-sensitive. |
7:55:30 AM |
@date |
The string returned by the @date is culture-sensitive and shows the current date when a Screen is opened. |
7/19/2010 |
@datelong |
Returns the current date in format ""dddd, dd MMMM yyyy". The function is culture-sensitive. |
Monday, July 19, 2010 |
@dateextendend |
Returns the current date in format "ddd, MMMM dd, yyyy". The function is culture-sensitive. |
Mon, July 19, 2010 |
@dateday |
Returns the current date in format "MM/dd/yyyy". The function is culture-sensitive. |
7/19/2010 |
@datemonth |
Returns the current date in format "MMMM dd". The function is culture-sensitive. |
July 19 |
@dateyear |
Returns the current date in format "yyyy MMMM". The function is culture-sensitive. |
July, 2010 |
@datetime |
Returns the current date in format "MM/dd/yyyy HH:mm:ss". The function is culture-sensitive. |
7/19/2010 7:55:30 AM |
@selection
The @selection is definitely the most popular substitution formula and can be used in conjunction with several parameters to customize the final output. It can be used in any Label or Button Caption, Title or Block Heading field.
Formula syntax |
Result |
Output example |
@Selection_Ex |
Returns the current Selection in the form of the name of the Entities on which a selection was made, followed by a comma separated list of selected members narrowed to 10 items (default is unlimited). |
Month: Jan.22, Feb.22, Mar.22 |
@Selection_Ex(Layout="Layout_Title") |
Returns the Layout Select. Layout=" " is the default value. |
Country: Japan, Spain |
@Selection_Ex(Layout="Layout_Title", Block="Block_Heading") |
Returns the Block Select. Block=" " is the default value. |
Sales person: Jim Smith |
@Selection_Ex(Display="Code") |
Returns the Code of Selected Items.
Display=”Default” is the default value. |
Continent: 03 South America |
@Selection_Ex(Interval="Range_Item") |
Returns which elements of the Selected Item-Set are showed. Available Values are:
Interval="All" is the default value |
Month: Apr.22 |
@Selection_Ex(Limit="n") |
If the number (m) of the Selected Items is greater than n (m>n) it doesn’t show the item codes and/or description but m/M where M is the number of available items for such Entity. If m<=n it works as usual. Limit="MaxValue" is the default value (no limitation) |
Month: 4 / 72 |
@Selection_Ex(Entity="Entity_Name") |
Hides the Entity Name that precedes the Selected Item List. Entity=" " is the default value |
Oct.22, Nov.22, Dec.22 |
When the @Selection_Ex formula is used in a Layout title or Block Heading the Layout and Block parameter must be omitted.
Two or more @Selection_Ex formulas can’t be combined nor concatenated in the same script.
The @Selection_Ex formula can’t have another @Selection_Ex formula as a parameter: i.e. the formula @Selection_Ex(Layout="Layout_Title") won't return any value if a @Selection_Ex formula has been used in the Layout title.