例: ユーザーの優先通貨オプションを定義する動的マッピング
次の例は、動的マッピングを使用してユーザーの優先通貨オプションを定義するuserpref_currencies.xmlファイルを示しています。
<UserCurrencyPreferences currencyTagMappingType="dynamic">
UserPrefCurrencyLogicalSQL>
<!-- In this SELECT statement, column1 contains the values to set the PREFERRED_CURRENCY variable, column2 contains the currency tag values, and column3 contains the values to set the currency.userPreference variable. -->
SELECT markets.userpreferences, markets.currencyTag, markets.userpreferencename FROM userCurrencyPreference
</UserPrefCurrencyLogicalSQL>
</UserCurrencyPreferences>
次の表は、論理SQL文の結果の例を示しています。
"Markets"."UserPreference" | "Markets"."CurrencyTag" | "Markets"."UserPreferenceName" |
---|---|---|
varchar |
varchar |
varchar |
orgc1 |
loc:en-BZ |
Org currency |
gc2 |
int:euro-1 |
Global currency 2 |
lc1 |
int:DEM |
Ledger currency |
gc1 |
int:USD |
Global Currency 1 |
次の図は、userpref_currencies.xmlファイルのSQL文から動的に生成された値が、「マイ・アカウント」ダイアログの「プリファレンス」タブにある「通貨」ボックスの通貨オプションのドロップダウン・リストにどのように表示されるかを示しています。このドロップダウン・リストは、ダッシュボード・ページのプロンプトで表示される内容に似ています。