Latest News

the latest news from our team

Set Value from a Keyed Declared Constant

For examples on how to implement Declared Constants, consult the following: Declared Constants for Production vs. Dev/Sandbox Accounts

A Keyed Declared Constant from an eFORMzCfg_User.xml file provides the value for this Variable Function.

The form of a declaration is:

<KeyedConstant Name=“OrderNbrLabels”>
 <Entry Key=“EN”>
 <![CDATA[Order Number]]>
 </Entry>
 <Entry Key=“FR”>
 <![CDATA[French Order Number]]>
 </Entry>
 </KeyedConstant>

If this Function is used in a number of Projects to refer to the same Keyed Declared Constant, when the Keyed Declared Constant must change, only the eFORMzCfg_User.xml file needs to be modified, not each Project.

Note: Changes to the eFORMzCfg.xml will get overwritten as this file is updated or overwritten on upgrades and installs.

You should consider using a Keyed Declared Constant when you need to choose one of several static values, depending on the value of some variable. Here are some examples:

In a drop-ship packing slip project, you support several packing slip types, and you want to choose the one to use based on the value of the customer ID.
• You have test and production credentials to be passed to a web service call and you need to choose the appropriate set of credentials depending on whether you’re running in test or in production. Create a Keyed Declared Constant for each credential, such as URL to call, user name, password, token, etc.”

Language Substitution

1. Add another Variable by position and enter ‘OrderNbrLabel1’ in the Name field.
2. Right click the Variable and select Add Function > Set value from a keyed declared constant.
3. Select the ‘OrderNbrLabels’ Keyed Declared Constant which was declared in the eFORMzCfg_Translations.xml. The Key Value should should be the Language Variable. The Keyed Constant is as follows:

<KeyedConstant Name=“OrderNbrLabels”>
 <Entry Key=“EN”>
 <![CDATA[Order Number]]>
 </Entry>
 <Entry Key=“FR”>
 <![CDATA[French Order Nbr]]>
 </Entry>
 <Entry Key=“GE”>
 <![CDATA[German Order Number]]>
 </Entry>
 </KeyedConstant>

The two-letter language code from the incoming data file will be picked up by the Language Variable. This is the Key Value, or the ‘Entry Key.’ For example, if the language code is ‘FR’ then the value of the ‘OrderNbrLabel1’ Variable will be the French Order Number.

Load Variable From a Keyed Declared Constant Pre-condition Procedure

1. Add another Variable by position and enter ‘OrderNbrLabel2’ in the Name field.
2. Right click the Form and select Add Pre-condition Procedure > Load Variable from a Keyed Declared Constant.
3. Enter a value for the Name field and select the System Variable ‘N/A’ from the Use variable drop-down menu.
4. Select the ‘OrderNbrLabels’ Keyed Declared Constant which was declared in the eFORMzCfg_Translations.xml. The Key Value should should be the Language Variable. The Variable should be the ‘OrderNbrLabel2’ Variable. The Keyed Constant is as follows:

<KeyedConstant Name=“OrderNbrLabels”>
 <Entry Key=“EN”>
 <![CDATA[Order Number]]>
 </Entry>
 <Entry Key=“FR”>
 <![CDATA[French Order Nbr]]>
 </Entry>
 <Entry Key=“GE”>
 <![CDATA[German Order Number]]>
 </Entry>
 </KeyedConstant>

The two-letter language code from the incoming data file will be picked up by the Language Variable. This is the Key Value, or the ‘Entry Key.’ For example, if the language code is ‘FR’ then the value of the ‘OrderNbrLabel2’ Variable will be the French Order Number.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code