Context Substitution Variables (CSV) and Query Macros are variables that can be used within IFS Applications in place of actual user input. For an example if a user needs to type in today's date into a date field when querying or Ordering a report, instead of typing "3/20/2007", the user could straight away type "#TODAY#", and the framework will evaluate the date for the user.
The use of Context Substitution Variables and Query Macros allows the ability to reuse configuration in default profiles for multiple users, and over a long period of time. For an example, the end user can save a query for Customer Orders for which the wanted delivery time is due TODAY.
The difference between Query Macros and CSV's is that Query Macros can only be used in query dialog. For an example, the end user can save a query for Customer Orders for which the wanted delivery time is due THIS_WEEK. This saved query can be used forever.
A list of Context Substitution Variables & Query macros will be shown on the dropdown for the 'Value' column in Query Dialog.
Context Substitution Variables can be used in Quick Report queries as well. For an example following query can be used in Quick Reports in IFS Windows Client.
SELECT ORDER_NO, AUTHORIZE_CODE, DATE_ENTERED FROM CUSTOMER_ORDER WHERE DATE_ENTERED = TO_DATE('#TODAY#', 'YYYY-MM-DD') AND AUTHORIZE_CODE ='#USER_DIRECTORY_ID#'
Report order wizards and scheduled reports are also compliant with Context Substitution Variables.
CSV Name | Description | Sample Values |
USER_DIRECTORY_ID | Directory ID of the logged in user. | ALEX |
USER_EMAIL | Email address of the logged in user. | alex@ifsworld.com |
USER_ID | Logged in user ID. | ALEX |
USER_LANGUAGE | Language currently in use by the logged in user. | en |
YESTERDAY | Date & Time range beginning from the start of yesterday till the end of yesterday. | 2006-10-02-00.00.00 |
START_OF_LAST_WEEK | Date & Time value of the start of last week. | 2006-09-24-00.00.00 |
END_OF_LAST_WEEK | Date & Time value of the end of last week. | 2006-09-30-23.59.59 |
START_OF_LAST_MONTH | Date & Time value of the start of last month. | 2006-09-01-00.00.00 |
END_OF_LAST_MONTH | Date & Time value of the end of last month. | 2006-09-30-23.59.59 |
START_OF_LAST_YEAR | Date & Time value of the start of last year. | 2005-01-01-00.00.00 |
END_OF_LAST_YEAR | Date & Time value of the end of last year. | 2005-12-31-23.59.59 |
TODAY | Date & Time range beginning from the start of today till the end of today. | 2006-10-03-00.00.00 |
START_OF_THIS_WEEK | Date & Time value of the start of this week. | 2006-10-01-00.00.00 |
END_OF_THIS_WEEK | Date & Time value of the end of this week. | 2006-10-07-23.59.59 |
START_OF_THIS_MONTH | Date & Time value of the start of this month. | 2006-10-01-00.00.00 |
END_OF_THIS_MONTH | Date & Time value of the end of this month. | 2006-10-31-23.59.59 |
START_OF_THIS_YEAR | Date & Time value of the start of this year. | 2006-01-01-00.00.00 |
END_OF_THIS_YEAR | Date & Time value of the end of this year. | 2006-12-31-23.59.59 |
TOMORROW | Date & Time range beginning from the start of tomorrow till the end of tomorrow. | 2006-10-04-00.00.00 |
START_OF_NEXT_WEEK | Date & Time value of the start of next week. | 2006-10-08-00.00.00 |
END_OF_NEXT_WEEK | Date & Time value of the end of next week. | 2006-10-14-23.59.59 |
START_OF_NEXT_MONTH | Date & Time value of the start of next month. | 2006-11-01-00.00.00 |
END_OF_NEXT_MONTH | Date & Time value of the end of next month. | 2006-11-30-23.59.59 |
START_OF_NEXT_YEAR | Date & Time value of the start of next year. | 2007-01-01-00.00.00 |
END_OF_NEXT_YEAR | Date & Time value of the end of next year. | 2007-12-31-23.59.59 |
LAST_WEEK | THIS_WEEK | NEXT_WEEK |
LAST_MONTH | THIS_MONTH | NEXT_MONTH |
LAST_YEAR | THIS_YEAR | NEXT_YEAR |