CurrencyField Element

CurrencyField is a descriptor element for a FormField element that defines the field that defines the currency for an amount field.

Note: To use more than one currency, Multicurrency can be enabled (AdministrationCurrency) and another currency can be added from the Currencies page. Currency IDs are stored in dbo.[CURRENCY] and Currency Set IDs are stored in dbo.[CURRENCYSET].

The example that follows hard-codes the currency ID in the Guid form field. Following the example are techniques for retrieving a currency ID.

      <common:FormField Caption="Code table value" FieldID="SOMEAMOUNT" DataType="Money">
        <common:CurrencyField CurrencyFieldID="CURRENCYID"/>
      </common:FormField>
      <common:FormField Caption="Currency field ID"
                        FieldID="CURRENCYID"
                        DataType="Guid"
                        DefaultValueText="D23878BF-AEE3-404B-969A-2B9C83120CA4"/>

      <common:FormField Caption="Code table value" FieldID="SOMEAMOUNT" DataType="Money">
        <common:CurrencyField CurrencyFieldID="CURRENCYID"/>
      </common:FormField>
      <common:FormField Caption="Currency field ID"
                        FieldID="CURRENCYID"
                        DataType="Guid"
                        DefaultValueText="6ABE6C7E-FEDC-473D-ABE8-505807C94E0E"/>

AppFxWebService request for currency ID:

Dim svc as New AppFxWebService()
Dim request as New CurrencyGetRequest()
Dim reply = svc.CurrencyGet(request)

From CLR or UI model with Blackbaud.AppFx.Server:

Blackbaud.AppFx.Server.CurrencyHelper.GetOrganizationCurrencyId(requestContext)

With Transact-SQL and a call to a Blackbaud Infinity scalar function:

dbo.UFN_CURRENCY_GETORGANIZATIONCURRENCY()