We use bind variables a lot in maximo. We are familiar with relationships like “LOCATION=:LOCATION and SITEID=:SITEID”, and conditions like “:CLASS='INCIDENT'”. “:LOCATION”, “:CLASS” are maximo bind variable. They are resolved to the actual value of the specified attribute of the current business object. Current business object means the object that the expression is evaluated against. Depending on the context, it is the parent object that the relationship is defined on, or the object a condition is evaluated against.
Less familiar to us, is that there is an additional set of bind variables that are not resolved to the values of attributes, instead, have their own special meanings and can also be used in maximo expressions.
:&OWNER&
It represents the MBO object that is the owner of the current MBO. This is always used with combination to field name or relationship name. Such as :&OWNER&.ATTR1 or:&OWNER&.RELATIONSHIP2.ATTR2. It is used when you need to get to a value of an object on the owner MBO or through one or multiple relationship from the owner MBO. This comes extremely handy if the current record has not been saved to the database and you need to get its value or its related value.
:&APPNAME&
It represents the application name that the current MBO is accessed through. For example, an object displayed on a dialog of WOTRACK application will have its application name as WOTRACK. But there will be cases that there is no owner application associated to an object, and in this case, empty string will be returned. This variable normally used in the conditions for conditional UI or data restrictions.
:&MBONAME&
It represents the name of the object. It comes handy when you define a common condition across different by similar objects.
:&OWNERNAME&
It resolves to the name of owner object of the current object.
:&PERSONID&
It resolves to the person id of the current logged in user.
:&USERNAME&
It resolves to the current log in user name.
:&DATE&
It represents a data string of current date when used in expression such as for communication template, and a real JDBC date function wrapping around the current date if used in relationships.
:&DATETIME&
Save as &DATE& but in DATETIME format.
:&HOSTNAME&
Normally used in communication template, it represents the URL of the server. It is as the property mxe.hostname.
:&UNIQUEID&
It resolves to the unique id of the current object.
:&synonymlist&_
This keyword is in lowercase. This resolves to a list of synonym values that can be directly used in a SQL. Following the &synonymlist&_ keyword, you specify the synonym domain name and a list of internal values. :&synonymlist&_DOMAINNAME[VALUE1,VALUE2,...ETC] will give you a string of ('synonymofvalue1', 'synonymofvalue2'...etc).This is very much recommended to be used in relationship where clause when you need to qualify the records by the synonym values of a synonym domain. The reason is that the resulted query will offer much better performance comparing to a subselect to synonym domain table.
No comments:
Post a Comment