Macros and Expressions in UI Components

Many strings used in the definition of UI components (such as label values, hrefs, and settings) can contain embedded macros and select clauses.

About Macros and Expressions

The $<> delimiters identify macro names. The system evaluates macros at run-time and before displaying in the UI.

Strings defined using macros and expressions cannot be internationalized.

Strings can include select clauses that are evaluated against the appropriate business object at run-time. The $<> delimiters identify select clauses. Select clauses generally use symbolic names and are preprocessed to perform any substitutions before submitting for evaluation. This example shows a macro in the href definition, a macro in the Image setting, as well as a select clause in the label definition of a tree menu (associated with a Line Item object):

MQL<2>print menu type_LineItem;
menu type_LineItem
description
label '$<attribute[attribute_EnteredName].value>'
href '${SUITE_DIR}/LineItemDetailsFS.jsp'
setting Image value ${COMMON_DIR}/iconSmallRFQLineItem.gif
setting Registered Suite value Sourcing
children
command SCSAttributeGroup
command SCSAttachment
command SCSSupplierExclusion
command SCSUDA
command SCSLineItemHistory

The following example shows a typical business object macro being used in the label definition of a tree menu associated with a Company object (the tree menu shows as the Categories menuin the UI):

MQL<3>print menu type_Company;
menu type_Company
description
label '$<name>'
href '${COMMON_DIR}/emxForm.jsp?form=type_Company&toolbar=APPCompanyDetailsToolBar&HelpMarker=emxhelpcompanyproperties&formHeader=emxComponents.Common.PropertiesPageHeading'
setting Image value ${COMMON_DIR}/iconSmallOrganization.gif
setting Registered Suite value Components
children
command APPBusinessSkills
command BusinessUnit
command PMCCalendar
command APPCapabilities
command APPCollaborationPartners
command Department
command APPFormats
command Location
command APPPlant
command People
command Regions
command APPSubsidiary
command APPCompanyImageManager
command APPCurrencyExchangeRates

Surround macros with quotes to ensure proper substitution for values that contain spaces.

Directory Macros

The following table lists the directory-specific macros that you can use in parameters and settings for dynamic UI components.

If you do not specify a path for a file, the system looks in the registered directory (as specified in emxSystem.properties for the registered application). If there is no registered directory, the system assumes the file is in the current directory.

Macro Name Use to have the system look for the file in:
${COMMON_DIR} The "common" directory obtained from the emxSystem.properties file. The key used is eServiceSuiteFramework.CommonDirectory = common.
${ROOT_DIR} The ematrix root directory obtained from emxSystem.properties using the key eServiceSuiteFramework.RootDirectory =.
${SUITE_DIR}

The application-specific directory obtained from emxSystem.properties based on the Registered Suite setting. For example, the key used for "Engineering Central" is eServiceSuiteEngineeringCentral.Directory = engineeringcentral.

Suite directories use the original application names.

${COMPONENT_DIR} The directory that contains common components, which is ematrix/component by default. The directory is obtained from eServiceSuiteFramework.ComponentDirectory = component in the emxSystem.properties file.

Select Expression Macros

You can define Select expression macros as $<SELECT EXPRESSION>, where the select expression can be any valid MQL select statement.

You can use Select expression macros in labels for configurable forms and in expression parameters.

Macros can be used as labels in headers for forms, but cannot be used in headers for tables or structure browsers.

Select expressions are evaluated at runtime against the current business object ID and relationship ID that is passed in. Some examples include:


  • $<type>
  • $<name>
  • $<revision>
  • $<attribute[$].value>
  • $<attribute[FindNumber].value>
  • $<from[relationship_EBOM].to.name>

Other Macros

You can also use the table selected count macro.

Macro Name Description

${TABLE_SELECTED_COUNT}

Substitutes the number of rows selected in the current table, including those selected on other pages within a paginated table.

Use in a confirmation message for a toolbar item to let user know how many rows are selected. Define the confirm message using the Confirm Message setting for a toolbar item command.