# CodeunitTranslator

# IntegrationFieldFixCPR

## <span class="mw-headline" id="bkmrk-what-it-does-1">What it does</span>

Cleans up external data in CPR format, for use in a scheduled integration.

String are cleaned using the CPR translateInput method. Data will be cleaned before inserting without the use of this codeunit, but lookups and such might fail if the CPR is formatted poorly.

## <span class="mw-headline" id="bkmrk-how-to-invoke-1">How to invoke</span>

Insert value in field mapping:

Designer &gt; Integration &gt; Import sources &gt; \[integration\] &gt; \[fieldmapping\] &gt; Codeunit handler

```
dk.p2e.blanket.codeunit.common.IntegrationFieldFixCPR
```

## <span class="mw-headline" id="bkmrk-configuration-1">Configuration</span>

<span class="mw-headline">None.</span>

## <span class="mw-headline" id="bkmrk-developer-info-1">Developer info</span>

- <span class="mw-headline">Type: [CodeunitTranslator](https://docs.tsnocode.com/books/codeunit-reference/chapter/translator)</span>
- <span class="mw-headline">Security: None</span>
- <span class="mw-headline">Classpath: dk.p2e.blanket.codeunit.common.IntegrationFieldFixCPR</span>

# IntegrationFieldFixDate

## <span class="mw-headline" id="bkmrk-what-it-does-1">What it does</span>

Cleans up external data in date format, for use in a scheduled integration.

String are cleaned using the date translateInput method. Data will be cleaned before inserting without the use of this codeunit, but lookups and such might fail if the date is not formatted as YYYY-MM-DD.

## <span class="mw-headline" id="bkmrk-how-to-invoke-1">How to invoke</span>

Insert value in field mapping Designer &gt; Integration &gt; Import sources &gt; \[integration\] &gt; \[fieldmapping\] &gt; Codeunit handler

```
  dk.p2e.blanket.codeunit.common.IntegrationFieldFixDate
```

## <span class="mw-headline" id="bkmrk-configuration-1">Configuration</span>

<span class="mw-headline">\[All possible configurations and where to edit them\]</span>

## <span class="mw-headline" id="bkmrk-developer-info-1">Developer info</span>

- <span class="mw-headline">Type: [CodeunitTranslator](https://docs.tsnocode.com/books/codeunit-reference/chapter/translator)</span>
- <span class="mw-headline">Security: None</span>
- <span class="mw-headline">Classpath: dk.p2e.blanket.codeunit.common.IntegrationFieldFixDate</span>

# IntegrationFieldLookupKey

## <span class="mw-headline" id="bkmrk-what-it-does-1">What it does</span>

Looks up another value based on the string provided, for use in a scheduled integration.

A lookup will be executed substituting the @VALUE@ in the SQL expression passed to the codeunit.

Note that the @VALUE@ is SQL escaped for security reasons.

## <span class="mw-headline" id="bkmrk-how-to-invoke-1">How to invoke</span>

Insert value in field mapping Designer &gt; Integration &gt; Import sources &gt; \[intergration\] &gt; \[fieldmapping\] &gt; Codeunit handler

```
dk.p2e.blanket.codeunit.common.IntegrationFieldLookupKey
```

## <span class="mw-headline" id="bkmrk-configuration-1">Configuration</span>

Insert an SQL expression in:

\[fieldmapping\] &gt; Configuration values

Example:

```
 SELECT Name FROM user WHERE Email = '@VALUE@';
```

## <span class="mw-headline" id="bkmrk-developer-info-1">Developer info</span>

- <span class="mw-headline">Type: [CodeunitTranslator](https://docs.tsnocode.com/books/codeunit-reference/chapter/translator)</span>
- <span class="mw-headline">Security: None</span>
- <span class="mw-headline">Classpath: dk.p2e.blanket.codeunit.common.IntegrationFieldLookupKey</span>

# IntegrationFieldValueMap

## <span class="mw-headline" id="bkmrk-what-it-does-1">What it does</span>

Looks up another value based on the string provided, for use in a scheduled integration.

Values will be swapped from a list provided to this codeunit.

An empty string will be returned if no match can be found.

## <span class="mw-headline" id="bkmrk-how-to-invoke-1">How to invoke</span>

Insert value in field mapping Designer &gt; Integration &gt; Import sources &gt; \[integration\] &gt; \[fieldmapping\] &gt; Codeunit handler

```
dk.p2e.blanket.codeunit.common.IntegrationFieldValueMap
```

## <span class="mw-headline" id="bkmrk-configuration-1">Configuration</span>

Insert value maps seperated by "@" in:

\[fieldmapping\] &gt; Configuration values

Example:

```
Tesla Model S@Large car
Hummer@Large car
Toyota Corolla@Medium car
Suzuki Swift@Small car
```

## <span class="mw-headline" id="bkmrk-developer-info-1">Developer info</span>

- <span class="mw-headline">Type: [CodeunitTranslator](https://docs.tsnocode.com/books/codeunit-reference/chapter/translator)</span>
- <span class="mw-headline">Security: None</span>
- <span class="mw-headline">Classpath: dk.p2e.blanket.codeunit.common.IntegrationFieldValueMap</span>