|
| 1 | +--- |
| 2 | +title: "Handling Missing Option Values" |
| 3 | +description: Learn how to prevent full synchronization from failing because the options differ in mapped fields. |
| 4 | +author: bholtorf |
| 5 | + |
| 6 | +ms.author: bholtorf |
| 7 | +ms.custom: na |
| 8 | +ms.reviewer: na |
| 9 | +ms.service: dynamics365-business-central |
| 10 | +ms.topic: article |
| 11 | +ms.date: 02/03/2020 |
| 12 | +--- |
| 13 | + |
| 14 | +# Handling Missing Option Values |
| 15 | +[!INCLUDE[d365fin](includes/cds_long_md.md)] contains only three option set fields that contain option values that you can map to [!INCLUDE[d365fin](includes/d365fin_md.md)] fields of Option type<!-- Option type, not enum? @Onat can you vertify this? --> for automatic synchronization. During synchronization, non-mapped options are ignored and the missing options are appended to the related [!INCLUDE[d365fin](includes/d365fin_md.md)] table and added to the **CDS Option Mapping** system table to handle manually later. For example, by adding the missing options in either product and then updating the mapping. This section describes how that works. |
| 16 | + |
| 17 | +The **Integration Table Mapping** page contains three maps for fields that contain one or more mapped option values. After a full synchronization, the **CDS Option Mapping** page contains the non-mapped options in the three fields respectively. |
| 18 | + |
| 19 | +| Record | Option Value | Option Value Caption | |
| 20 | +|----------------------------|--------------|----------------------| |
| 21 | +| Payment Terms: NET30 | 1 | Net 30 | |
| 22 | +| Payment Terms: 2%10NET30 | 2 | 2% 10; Net 30 | |
| 23 | +| Payment Terms: NET45 | 3 | Net 45 | |
| 24 | +| Payment Terms: NET60 | 4 | Net 60 | |
| 25 | +| Shipment Method: FOB | 1 | FOB | |
| 26 | +| Shipment Method: NOCHARGE | 2 | No Charge | |
| 27 | +| Shipping Agent: AIRBORNE | 1 | Airborne | |
| 28 | +| Shipping Agent: DHL | 2 | DHL | |
| 29 | +| Shipping Agent: FEDEX | 3 | FedEx | |
| 30 | +| Shipping Agent: UPS | 4 | UPS | |
| 31 | +| Shipping Agent: POSTALMAIL | 5 | Postal Mail | |
| 32 | +| Shipping Agent: FULLLOAD | 6 | Full Load | |
| 33 | +| Shipping Agent: WILLCALL | 7 | Will Call | |
| 34 | + |
| 35 | +The content of the **CDS Option Mapping** page is based on enum values in the **CDS Account** table. In [!INCLUDE[d365fin](includes/cds_long_md.md)], the following fields on the account entity are mapped to fields on the customer and vendor records: |
| 36 | + |
| 37 | +- **Address 1: Freight Terms** of data type Enum, where values are defined as follow: |
| 38 | + |
| 39 | +``` |
| 40 | +enum 5335 "CDS Shipment Method Code" |
| 41 | +{ |
| 42 | + Extensible = true; |
| 43 | + value(0; " ") { Caption = ' '; } |
| 44 | + value(1; "FOB") { Caption = 'FOB'; } |
| 45 | + value(2; "NoCharge") { Caption = 'No Charge'; } |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +- **Address 1: Shipping Method** of data type Enum, where values are defined as follows: |
| 50 | + |
| 51 | +``` |
| 52 | +enum 5336 "CDS Shipping Agent Code" |
| 53 | +enum 5336 "CDS Shipping Agent Code" |
| 54 | +{ |
| 55 | + Extensible = true; |
| 56 | + value(0; " ") { Caption = ' '; } |
| 57 | + value(1; "Airborne") { Caption = 'Airborne'; } |
| 58 | + value(2; "DHL") { Caption = 'DHL'; } |
| 59 | + value(3; "FedEx") { Caption = 'FedEx'; } |
| 60 | + value(4; "UPS") { Caption = 'UPS'; } |
| 61 | + value(5; "PostalMail") { Caption = 'Postal Mail'; } |
| 62 | + value(6; "FullLoad") { Caption = 'Full Load'; } |
| 63 | + value(7; "WillCall") { Caption = 'Will Call'; } |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +- **Payment Terms** of data type Enum, where values are defined as follows: |
| 68 | + |
| 69 | +``` |
| 70 | +enum 5334 "CDS Payment Terms Code" |
| 71 | +{ |
| 72 | + Extensible = true; |
| 73 | + value(0; " ") { Caption = ' '; } |
| 74 | + value(1; "Net30") { Caption = 'Net 30'; } |
| 75 | + value(2; "2%10Net30") { Caption = '2% 10; Net 30'; } |
| 76 | + value(3; "Net45") { Caption = 'Net 45'; } |
| 77 | + value(4; "Net60") { Caption = 'Net 60'; } |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +All of the [!INCLUDE[d365fin](includes/d365fin_md.md)] enums above are mapped to option sets in [!INCLUDE[d365fin](includes/cds_long_md.md)]. |
| 82 | + |
| 83 | +### Extending Option Sets in [!INCLUDE[d365fin](includes/d365fin_md.md)] |
| 84 | +1. Create a new AL extension. |
| 85 | + |
| 86 | +2. Add an Enum extension for the options that you want to extend. Be sure that you use the same value. |
| 87 | + |
| 88 | +``` |
| 89 | +enumextension 50100 "CDS Payment Terms Code Extension" extends "CDS Payment Terms Code" |
| 90 | +{ |
| 91 | + value(779800001; "Cash Payment") { Caption = 'Cash Payment'; } |
| 92 | + value(779800002; "Transfer") { Caption = 'Transfer'; } |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +> [!IMPORTANT] |
| 97 | +> You must use the same option ID values from [!INCLUDE[d365fin](includes/cds_long_md.md)] when you extend the [!INCLUDE[d365fin](includes/d365fin_md.md)] enum. Otherwise synchronization will fail. |
| 98 | +
|
| 99 | +> [!NOTE] |
| 100 | +> The first ten characters of the new option value names and captions must be unique. For example, two options named "Transfer 20 working days" and "Transfer 20 calendar days" will cause an error because both have the same first 10 characters, "Transfer 2". Name them, for example, "TRF20 WD" and "TRF20 CD." |
| 101 | +
|
| 102 | +### Update [!INCLUDE[d365fin](includes/cds_long_md.md)] Option Mapping |
| 103 | +Now you can recreate the mapping between [!INCLUDE[d365fin](includes/cds_long_md.md)] options and [!INCLUDE[d365fin](includes/d365fin_md.md)] records. |
| 104 | + |
| 105 | +On the **Integration Table Mapping** page, choose the line for the **Payment Terms** map, and then choose the **Synchronize Modified Records** action. The **CDS Option Mapping** page is updated with the additional records below. |
| 106 | + |
| 107 | +| Record | Option Value | Option Value Caption | |
| 108 | +|--------------------------------|----------------|----------------------| |
| 109 | +| Payment Terms: NET30 | 1 | Net 30 | |
| 110 | +| Payment Terms: 2%10NET30 | 2 | 2% 10; Net 30 | |
| 111 | +| Payment Terms: NET45 | 3 | Net 45 | |
| 112 | +| Payment Terms: NET60 | 4 | Net 60 | |
| 113 | +| **Payment Terms: CASH PAYME** | **779800001** | **Cash Payment** | |
| 114 | +| **Payment Terms: TRANSFER** | **779800002** | **Transfer** | |
| 115 | + |
| 116 | +The **Payment Terms** table in [!INCLUDE[d365fin](includes/d365fin_md.md)] will then have new records for the [!INCLUDE[d365fin](includes/cds_long_md.md)] options. In the following table new options are in bold font . Italic rows represent all options that can now be synchronized. Remaining rows represent options are not in use and will be ignored during synchronization. You can remove them or extend CDS options with the same names.) |
| 117 | + |
| 118 | +| Code | Due Date Calculation | Discount Date Calculation | Discount % | Calc. Pmt. Disc. on Cr. Memos | Description | |
| 119 | +|------------|----------------------|---------------------------|------------|-------------------------------|-------------------| |
| 120 | +| 10 DAYS | 10D | | 0. | FALSE | Net 10 days | |
| 121 | +| 14 DAYS | 14D | | 0. | FALSE | Net 14 days | |
| 122 | +| 15 DAYS | 15D | | 0. | FALSE | Net 15 days | |
| 123 | +| 1M(8D) | 1M | 8D | 2. | FALSE | 1 Month/2% 8 days | |
| 124 | +| 2 DAYS | 2D | | 0. | FALSE | Net 2 days | |
| 125 | +| *2%10NET30* | | | 0. | FALSE | | |
| 126 | +| 21 DAYS | 21D | | 0. | FALSE | Net 21 days | |
| 127 | +| 30 DAYS | 30D | | 0. | FALSE | Net 30 days | |
| 128 | +| 60 DAYS | 60D | | 0. | FALSE | Net 60 days | |
| 129 | +| 7 DAYS | 7D | | 0. | FALSE | Net 7 days | |
| 130 | +| ***CASH PAYME*** | | | 0. | FALSE | | |
| 131 | +| CM | CM | | 0. | FALSE | Current Month | |
| 132 | +| COD | 0D | | 0. | FALSE | Cash on delivery | |
| 133 | +| *NET30* | | | 0. | FALSE | | |
| 134 | +| *NET45* | | | 0. | FALSE | | |
| 135 | +| *NET60* | | | 0. | FALSE | | |
| 136 | +| ***TRANSFER*** | | | 0. | FALSE | | |
| 137 | + |
| 138 | +## See Also |
0 commit comments