%Market system variable

Description

The %Market system variable returns a three-character String value for the Market property of the current component. This is useful if you want to add market-specific PeopleCode functionality to a component. For example:

if %Component = COMPONENT.PERSONAL_DATA then
   /* do some stuff that applies to all localized version */
   :
   :
   /* do some stuff that differs by market */
   evaluate %Market
      when = "USA"
       /* do usa stuff */
         break;
      when = "GER"
         /* do german stuff */
   end-evaluate;
end-if;

The Market property of a component specifies a component’s target market. This property is set when a component is initially saved or cloned.

Components that are used on a global basis have a market setting of "GBL". Variations of components targeted at a specific market can have a local Market setting, for example "FRA". This enables developers to avoid cloning, renaming, and coding distinct PeopleCode in market-specific components. Instead, they can create a single component with market-specific PeopleCode, then clone the component, applying different Market property settings.

Because the %Market string is a three-character string like Country Code, Country Codes can be used as market settings where appropriate.

Considerations Using %Market in Application Engine Programs

Whenever %Market resolves to no value, it is processing in global ('GBL'). The absence of a value should be treated the same as if the value is 'GBL'.

To process a non-GBL market, a row must be created in PS_AEREQUESTTBL with the desired market value placed in the MARKET field of that row.

Note:

You must make this change to the table for every application engine program PeopleCode that refers to %Market.

Considerations Using %Market in Custom Buttons in Activity Guides

When you use %Market in custom buttons in an activity guide, it resolves to no value. Custom buttons use iScript, which does not have a reference to the component, so %Market resolves to no value.