# 710 · opportunityproductsnewfromce

> Technisches Mapping des Jobs `opportunityproductsnewfromce` (`CEOpportunityProducts`).

---

LLMS index: [llms.txt](/llms.txt)

---

| Eigenschaft | Wert |
|---|---|
| Order | 710 |
| Job | `opportunityproductsnewfromce` |
| Mapping | `CEOpportunityProducts` |
| Richtung | CE → BC |
| Quellverbindung | CRM_Test |
| Zielverbindung | BC_Test |
| Quelltabelle (API) | `opportunityproduct` aus `BC_Test-seitig, kein API-Pfad` |
| Zieltabelle | `acdopportunitycalculationelements` |
| Zeitplan | 0 */3 * * * * |
| Filter | `JSON-Filter: IsNull(wysa_bcsystemid) UND OptionSetValue(wysa_synctobc=799840000)` |
| Watermark | — |
| Response-Job | `opportunityproductsresponsefrombc` |
| Fachliche Doku | [Neue Verkaufschancen-Position nach BC](../verkaufschance/ceopportunityproducts/) |

## Feldzuordnung

| Quellfeld | Zielfeld | Operation | Details |
|---|---|---|---|
| `description` | `description` | — | — |
| `wysa_margin` | `profitLCY` | — | — |
| `wysa_bcamount` | `amountLCY` | — | — |
| `wysa_bcamountvat` | `amountIncludingVATLCY` | — | — |
| `_opportunityid.wysa_bcopportunitynumber` | `opportunityNo` | LookupValue | liest `wysa_bcopportunitynumber` aus `opportunity` über `opportunityid` (kein Cache) |
| `_productid.wysa_bccode` | `opportunityElementCode` | LookupValue | liest `wysa_bccode` aus `product` über `productid` |
| `quantity` | `quantity` | — | — |
| `wysa_bcsystemid` | `systemId` | — · **Schlüssel** | — |

## Alternate Key

```json
{
  "keyType": "Id",
  "keyName": "wysa_bcsystemid",
  "ignoreEmptySourceKey": false,
  "keyRank": 0
}
```

## Weitere technische Details

### Transformationen im Detail

Beide Lookups mit `LookupType: Attribute`:

| Quellfeld | Nachschlagetabelle | Nachschlagefeld | Zielfeld |
|---|---|---|---|
| `opportunityid` | `opportunity` | `wysa_bcopportunitynumber` | `opportunityNo` |
| `productid` | `product` | `wysa_bccode` | `opportunityElementCode` |

```json
{
  "Operations": [{
    "Name": "LookupValue",
    "Parameters": {
      "LookupType": "Attribute",
      "SourceField": "opportunityid",
      "LookupTable": "opportunity",
      "LookupField": "wysa_bcopportunitynumber",
      "UseCache": false
    }
  }, {
    "Name": "LookupValue",
    "Parameters": {
      "LookupType": "Attribute",
      "SourceField": "productid",
      "LookupTable": "product",
      "LookupField": "wysa_bccode",
      "UseCache": true
    }
  }]
}
```

Die beiden Lookups unterscheiden sich im Cache-Verhalten: Die Verkaufschancennummer wird
**ohne** Cache aufgelöst (`UseCache: false`), der Produktcode **mit** Cache
(`UseCache: true`). Genau diese beiden Auflösungen begründen die Reihenfolgeabhängigkeit: `opportunity`
liefert die Nummer erst nach `opportunitiesresponsefrombc` (261), `product` den Code
erst nach dem Abgleich in `opportunityelementsfrombc` (190). Beide Vorgänger laufen im
Zwei-Minuten-Takt, dieser Job im Drei-Minuten-Takt.

### Beobachtungen

* Das Feld `wysa_bcsystemid` wird auf `systemId` gemappt und dient als Schlüssel —
  obwohl der Filter des Jobs voraussetzt, dass es leer ist. Es gibt keinen
  `dataverseId`-Umweg wie bei Firma, Kontakt und Verkaufschance.
* Dieser Job schreibt den Schlüssel in das BC-Feld `systemId`, der Job
  `opportunityproductsupdatesfromce` in das Feld `id` — dieselbe API Page, zwei
  verschiedene Feldnamen.
* Der Filter verwendet `wysa_synctobc` ohne „2", abweichend vom Feldnamen
  `wysa_sync2bc` an der Verkaufschance.
