Handling missing option values

This article is intended for a technical audience. The processes it describes require the help of a developer.

Dataverse contains three option set fields that contain values that you can map to Business Central fields of the Option type for automated synchronization. During synchronization, nonmapped options are ignored and the missing options are appended to the related Business Central table and added to the Dataverse Option Mapping system table to handle manually later. For example, by adding the missing options in either product and then updating the mapping.

The Integration Table Mapping page contains three fields that contain one or more mapped option values. After a full synchronization, the Dataverse Option Mapping page contains the nonmapped options in the three fields.

RecordOption ValueOption Value Caption
Payment Terms: NET301Net 30
Payment Terms: 2%10NET3022% 10; Net 30
Payment Terms: NET453Net 45
Payment Terms: NET604Net 60
Shipment Method: FOB1FOB
Shipment Method: NOCHARGE2No Charge
Shipping Agent: AIRBORNE1Airborne
Shipping Agent: DHL2DHL
Shipping Agent: FEDEX3FedEx
Shipping Agent: UPS4UPS
Shipping Agent: POSTALMAIL5Postal Mail
Shipping Agent: FULLLOAD6Full Load
Shipping Agent: WILLCALL7Will Call

The content of the Dataverse Option Mapping page is based on enum values in the CRM Account table. In Dataverse, the following fields on the account table are mapped to fields on the customer and vendor records:

  • Address 1: Freight Terms of data type Enum, where values are defined as follows:
enum 5335 "CDS Shipment Method Code"
{
    Extensible = true;
    value(0; " ") { Caption = ' '; }
    value(1; "FOB") { Caption = 'FOB'; }
    value(2; "NoCharge") { Caption = 'No Charge'; }
}
  • Address 1: Shipping Method of data type Enum, where values are defined as follows:
enum 5336 "CDS Shipping Agent Code"
{
    Extensible = true;
    value(0; " ") { Caption = ' '; }
    value(1; "Airborne") { Caption = 'Airborne'; }
    value(2; "DHL") { Caption = 'DHL'; }
    value(3; "FedEx") { Caption = 'FedEx'; }
    value(4; "UPS") { Caption = 'UPS'; }
    value(5; "PostalMail") { Caption = 'Postal Mail'; }
    value(6; "FullLoad") { Caption = 'Full Load'; }
    value(7; "WillCall") { Caption = 'Will Call'; }
}
  • Payment Terms of data type Enum, where values are defined as follows:
enum 5334 "CDS Payment Terms Code"
{
    Extensible = true;
    value(0; " ") { Caption = ' '; }
    value(1; "Net30") { Caption = 'Net 30'; }
    value(2; "2%10Net30") { Caption = '2% 10; Net 30'; }
    value(3; "Net45") { Caption = 'Net 45'; }
    value(4; "Net60") { Caption = 'Net 60'; }
}

All of the Business Central enums are mapped to option sets in Dataverse.

Extending option sets in Business Central

  1. Create a new AL extension.

  2. Add an Enum extension for the options that you want to extend. Be sure that you use the same value.

enumextension 50100 "CDS Payment Terms Code Extension" extends "CDS Payment Terms Code"
{
    value(779800001; "Cash Payment") { Caption = 'Cash Payment'; }
    value(779800002; "Transfer") { Caption = 'Transfer'; }
}

Important


You must use the same option ID values from Dataverse when you extend the Business Central enum. Otherwise synchronization will fail.

Important


Do not use the "," character in the enum values and captions. This is currently not supported by the Business Central runtime.

Note

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."

Update Dataverse option mapping

Now you can recreate the mapping between Dataverse options and Business Central records.

On the Integration Table Mapping page, choose the line for the Payment Terms map, and then choose the Synchronize Modified Records action. The Dataverse Option Mapping page is updated with the following records.

RecordOption ValueOption Value Caption
Payment Terms: NET301Net 30
Payment Terms: 2%10NET3022% 10; Net 30
Payment Terms: NET453Net 45
Payment Terms: NET604Net 60
Payment Terms: CASH PAYME779800001Cash Payment
Payment Terms: TRANSFER779800002Transfer

The Payment Terms table in Business Central has new records for the Dataverse 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 aren't in use and are ignored during synchronization. You can remove them or extend Dataverse options with the same names.

CodeDue Date CalculationDiscount Date CalculationDiscount %Calc. Pmt. Disc. on Cr. MemosDescription
10 DAYS10D0.FALSENet 10 days
14 DAYS14D0.FALSENet 14 days
15 DAYS15D0.FALSENet 15 days
1M(8D)1M8D2.FALSE1 Month/2% 8 days
2 DAYS2D0.FALSENet 2 days
2%10NET300.FALSE
21 DAYS21D0.FALSENet 21 days
30 DAYS30D0.FALSENet 30 days
60 DAYS60D0.FALSENet 60 days
7 DAYS7D0.FALSENet 7 days
CASH PAYME0.FALSE
CMCM0.FALSECurrent Month
COD0D0.FALSECash on delivery
NET300.FALSE
NET450.FALSE
NET600.FALSE
TRANSFER0.FALSE

Mapping the Tables and Fields to Synchronize

Find free e-learning modules for Business Central here