There are two macros formats. One format is prefixed with the % sign and one is prefixed with the ~ character. Not all macros are supported in all contexts. The context for which the macro is supported is noted in the description of the macro. Macros are used in the following contexts:
-
Class and Screen Titles
-
Default Values
-
Keytype Maps
-
Filter Constraints
-
Report Templates
The ~ and % characters are reserved for use with macros. Using them in a string that does not include a macro may produce unexpected results.
The following macros are prefixed with %:
Macro |
Description |
---|---|
%A<ID#> or %A(2045.2054) |
Used in to reference attributes. Replace <ID#> with the attribute's ID number. If you are referencing a related attribute, the attribute's identification path must be enclosed in parentheses. Note:
This only supported within the Class and Screen Titles context. |
%C |
This is the object's class display name. Note:
This only supported within the Class and Screen Titles context. |
%D |
This is today's date (or current system date). The following are examples of how this macro can be used in equations: %D[+14] is today + 14 days. %D[-30] is today less 30 days. %D[+395:%m-01-%y] is today, plus 395 days. The date is formatted to the first of the calculated month. The format pattern forces the day to 01, but uses the date's actual month and year. 4 digit year is used. In addition, when working with alphanumeric attributes, MMMM yyyy can be used to denote the month and the year converted to a string value. Example: January 2015. Addition and subtraction can be used for alphanumeric fields using the %D macro. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%D1 |
This is the date created. Note:
This only supported within the Class and Screen Titles context. |
%D2 |
This is the date last modified. Note:
This only supported within the Class and Screen Titles context. |
%DT |
This is today's date (or current system date). or current date/time (depending on data type of variable). Note:
Time is stored as 00:00:00. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%DF |
This is the first day of the current month. Note:
Time is stored as 00:00:00. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%DL |
This is the last day of the current month. An example of how this macro can be used in a equation is the following: %DL[+1] sets the value to the first of next month. Note:
Time is stored as 00:00:00. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%DW |
The previous weekday. Friday is considered the last day of the week. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%DB |
This is the last business day before the current day. Note:
Time is stored as 00:00:00. Note:
This is supported in the Default Values, Keytype Maps, Filter Constraints, and Report Templates contexts. |
%E |
Returns the current user's email address. |
%E:<nameofuser> |
This will return the email address for the user specified, where <nameofuser> is the user name of the user for which you want to obtain the email address. |
%G:<nameofusergroup> |
This will return the email addresses for the users belonging to the specified user group, where <nameofusergroup> is the name of the user group that contains the users for which you want to obtain email addresses. |
%N |
This is the class name. Note:
This only supported within the Class and Screen Titles context. |
%R |
This is the real name of the logged in user. Note:
This is supported in all contexts. |
%S[SeqName] |
This is the next value from the sequence specified in the brackets. Some examples of how this macro can be used are the following: %S[SeqName:%X] formats the value in HEX (char type field required). %S[SeqName:C-%ld-AA] formats the value to include static characters. %ld is representative of where the next sequence value will appear in the value. For example, if the next sequence value is 1001, the value will be C-1001-AA. Note:
This is supported in the Default Values context. |
%U |
This is the user name of the logged in user. Note:
This is supported in all contexts. |
%U1 |
This is the created by user. Note:
This only supported within the Class and Screen Titles context. |
%U2 |
This is the last modified user. Note:
This only supported within the Class and Screen Titles context. |
%U3 |
This is the create by user's real name. Note:
This only supported within the Class and Screen Titles context. |
%U4 |
This is the last modified user's real name. Note:
This only supported within the Class and Screen Titles context. |
%# |
This is the objectID of the current object. Note:
This only supported within an object context using any of the following contexts: Class and Screen Titles, Keytype Maps, Filter Constraints, and Report Templates |
The following macros are prefixed with ~.
Code |
Description |
---|---|
~Empty |
Returns results for empty values. This will not return values if blank values are stored as NULL. In an Oracle database, this will return NULL values. Note:
This is supported in Keytype Maps and Filter Constraints contexts. |
~Null |
Returns results for NULL values.This checks directly for a NULL value in an attribute value within the database. Note:
This is supported only when setting attribute values in a manner that does not allow blank values. Note:
This macro is supported for security attributes when used to match empty attribute values. |
~User |
Logged on user name (for example: "MANAGER"). When used in the context of an object, this will be the CreatedBy user for the object. Note:
This is supported in all contexts. You can use ~User to set the default value for a logged in user for attribute related to an external class by using the following syntax: ~User[<NameofAttributeinExternalClass>] You can use ~User to set the default value for a logged in user for attribute related to an external extension class by using the following syntax: ~User[<externalClassName>.<NameofAttribute>] |
~<usergroupname> |
Note:
This can be used in conjunction with external classes connected to a table in the OnBase database. Returns a list of user IDs that exist in the user group specified between <>. This constraint can be used when an application is configured with an external class that connects to the OnBase database user table and the attribute this constraint is configured for points to the appropriate database user table (e.g. useraccount table). The attribute for this constraint must contain a user’s identifier (e.g. usernum). Note:
Only the equal to (=) and not equal to (<>) operators are supported with this constraint. Note:
This is only supported in the Filter Constraints context. As an example, you can use this macro for a class with an Owner attribute that is a relationship to an external class (sources from a user table). This macro can apply a constraint: "where the Owner is in the Executive user group". Configuration of such macro would be: Attribute: Owner.ID | Operator: = (equal) | Value: ~<Executives> |
~Realname |
Logged on user's real name.When used in the context of an object, this will be the CreatedBy user for the object. Note:
This is supported in all contexts. |
~ObjectID |
This is the objectID of the current object. Note:
This only supported within the context of an object. |
~Today ~T |
The current date. Note:
This is supported in all contexts. |
~FirstOfMonth |
First day of current month. Note:
This is supported in all contexts. |
~LastOfMonth |
Last day of current month. Note:
This is supported in all contexts. |
~LastWeekDay |
The previous weekday. Friday is considered the last day of the week. Note:
This is supported in all contexts. |
~LastBusinessDay |
Last business day before the current day. If the day of the week is Sunday, Saturday will be used as the last business day. Note:
This is supported in all contexts. |
~[attributename] |
This is typically used for filters embedded on a view, but has other specialized uses where a “parent object” context is available. This macro, also known as Dynamic Fixed Constraint, gets the named attribute's database value from the currently displayed object when used in a lookup field and gets the database value from the active row within an embedded filter. It uses that value as the filter constraint. If a filter with this constraint is executed from the filter bar, the query will return no results. This macro can be used with a custom header when using a filter already configured with this macro. Note:
This is only supported in the Filter Constraints context. |
~[<attributename>] |
This macro is typically used in filter constraints attached to cascading filter-backed datasets. To accomplish this, a parent attribute and a child attribute would be configured using a filter data set for the child attribute. The child attribute, whose drop-down values will be determined by the value selected for the parent attribute, would need a filter data set assigned that is configured with a fixed constraint of ~[<attributename>], where attributename is the name of the parent attribute. The child attribute value options will be based on the value of the parent attribute value selected using this method. |
~Workflow[life cycle name'ueue name] |
This can be used restrict the filter results set to a list of objects that are in or not in a specific life cycle and/or a specific queue in the named life cycle. Select objectID as the attribute and = or <> as the operator. = will return objects in the specified life cycle/queue. <> will return objects not in the specified life cycle. The life cycle name is required and must match exactly the name of the life cycle as it appears in Workflow (spaces included). The queue name can be any queue name from the specified life cycle, or the "*" symbol to return in all queues of the life cycle. Note:
Load balancing is ignored when using the "*" symbol for the queue name. If the life cycle queue is load balanced, load balancing is respected and the objects load balanced to the current user will be returned. If you want to ignore load balancing, you must use the following syntax: ~Workflow[life cycle name\'ueue name] The double backslash between the life cycle name and the queue name specifies that load balancing should be ignored and everything in the queue should be returned that meets the constraints. Note:
This is only supported in the Filter Constraints context. |
~{propertyName} |
This will insert the session property value of the Workflow property name specified. This will return a value formatted as a string. Note:
This is supported in all contexts. |
~[:AssociationClassName] |
This will start on the current object and traverse the association class specified to find the associated object(s). Note:
This will work with standard association classes or advanced association classes. Advanced association classes can have no more than 2 relationship attributes. Note:
This is only supported in the Filter Constraints context. You can also specify a secondary attribute to use to return the associated objects. Specify the source's related attribute name followed by the target's related attribute name within [] to specify a secondary attribute. This will match the relationships by the first attribute specified and return what is pointed to by the second attribute. Example: ~[:AssociationClassName[SourceRelatedAttributeName/TargetRelatedAttributeName]] In the case of a same class advanced association, the relationship defined should be traversed both ways, so append a + after the secondary attribute definition. Example: ~[:AssociationClassName[SourceRelatedAttributeName/TargetRelatedAttributeName]+] |
~[:AssociationClassAtoB:AssociationClassBtoC] |
This will return associated object(s) in the class represented by C in the example that are associated with the class represented by A in the example through the class represented by B in the example. Note:
This will work with standard association classes or advanced association classes. Advanced association classes can have no more than 2 relationship attributes. Note:
This is only supported in the Filter Constraints context. |
~[RelatedAttributeName:AssociationClassName] |
This will take the value of the specified related attribute of the current object and use it to find the related object, then find the associated object(s) in the association class specified. Note:
This will work with standard association classes or advanced association classes. Advanced association classes can have no more than 2 relationship attributes. Note:
This is only supported in the Filter Constraints context. |
~!DataSetName |
This is a filter constraint macro, usable only on the value side of a constraint. This will return objects that have a value in the list of values in a named data set. For example: AttributeName = ~!DataSetName Note:
This is only supported in the Filter Constraints context. |
~?FilterName ~?{propertyName}FilterName |
This is a filter constraint macro, usable only on the value side of a constraint, where the only supported operators are = (treated like an IN operator) and <> (works like NOT IN). The filter is executed and for each result the first column of the view column set is returned. Numbers and strings are supported. If a property name is provided, the filter is run the first time the constraint is encountered for the current session and the results are saved in a WorkView session property of the name specified. Any subsequent filter run will find that property in the session cache and use it directly. If the filter returns no results, the in clause is set to (null) which should always return an empty list. For example: AttributeName = ~?Filtername Note:
This is only supported in the Filter Constraints context. |
Any of the date related fixed constraints can be used as a "base" for the following:
Code |
Description |
---|---|
%D[+#] ~Today+# |
# of days specified from the current date. You can format the date. The following is an example: %D[+3:MMMM dd yyyy] ~Today+3:MMMM dd yyyy |
%D[-#] ~Today-# |
# of days specified before the current date. |
~LastOfMonth+#:%m-01-%Y |
Last day of current month + the # specified, and then the first of whatever month that falls in. (if any day in June, should always be 6/1). |
%D[+#M] ~Today+#M |
# of months specified from the current date. |
%D[-#M] ~Today-#M |
# of months specified before the current date. |
%D[+#Y] ~Today+#Y |
# of years specified from the current date. |
%D[-#Y] ~Today-#Y |
# of years specified before the current date. |