On the General tab of the import definition you can set the Use Config. Template setting to true. This will make a new tab appear.
On this Configuration Templates tab, additional setup should be done.
There are two ways to use configuration templates. The first and easiest to setup is to use the same configuration template for each record created by the definition.
In this case, leave Code is Temporary Value at false and for Config. Template Code select the template you want to use.
A template can be applied right after the key, which is in this case most likely okay. If your definition requires to apply the template later on, you can choose to apply after Field and select the field after which the template will be applied.
The second possibility is to apply different configuration templates, based on an imported value. For example, in case you are importing customers, you might want to apply a certain template based on the country code of the imported customer.
In this case, you will need to process the field with the country code before you can apply the configuration template.
So, on the Configuration Template tab, for Apply After, choose Field. For Field No. select the country code field.
Next we have to set up some conversions to translate country codes to configuration templates.
For example, create a conversion (code: COUNTRYTOTEMPL)
|External Value||Internal Value|
Add the following functions to the country code definition line:
- SETTEMPVAL (for example: 001_country, this saves the original country code value).
- CONVEXTTOINT (COUNTRYTOTEMPL, this converts the country code to a template code, based on the conversion table).
- SETTEMPVAL (for example, 001_template, this saves the template code value).
- GETTEMPVAL (001_country, this retrieves the original country code value).
Not the original country code is written to the country code field. After this, the configuration template will be applied.
To finish the Configuration Template tab, set Code is Temporary Value to true, and for Config. Template Code enter 001_template.
Now, in case the country code was NL, the CUSTDOMESTIC template will be applied, while in case the country code was US, the CUSTEXPORT template will be applied, and so on.
Need more help with this?