The concept of domain values is used a lot in the RamBase API resources. Domain values are a set of values that is possible to use (or have been used) for one or more fields in the API resources. One domain value is sometimes referred to as a DOV, and has the following properties:
The key/value used and stored in the API resources.
Description of the domain value. Visible in GET requests by adding query parameter $showDomainDescriptions=true.
The sorting index to be used for the domain value. When equal priority, domain values are sorted by the key.
In most of the RamBase client applications these fields are presented as drop downs, both when filtering and when selecting value to update and store.
Applicable domain values
Sales order and shipping advices in RamBase has a property called ShippingDay, which specifies when the goods should be shipped. The selected value will be used to calculate the scheduled shipping date for each item.
The field is of datatype string, but only strings matching the keys of the domain values is allowed: V1, V2 ,V3, V4, V5, W1, W2, W3, W4, W5, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D21
Note that these domain values represent all possible domain values. The applicable domain values might be a different list pending on the requesting user, company requesting in, activated modules and more.
When hovering a field with domain values in the API documentation, a link to the API resource to use for retrieving these applicable domain values is presented. It is also possible to retrieve this URL by using a metadata request.
The following URL would be retrieved for the ShippingDay field:
The result could be like this:
'description': 'Monday week before delivery date'
'description': 'Tuesday week before delivery date'
'description': 'Wednesday week before delivery date'
'description': 'Thursday week before delivery date'
'description': 'Friday week before delivery date'
'description': 'Monday week of delivery date'
'description': 'Tuesday week of delivery date'
'description': 'Wednesday week of delivery date'
'description': 'Thursday week of delivery date'
'description': 'Friday week of delivery date'
'description': 'On delivery date'
'description': '1 day before delivery date'
'description': '2 days before delivery date'
'description': '3 days before delivery date'
'description': '4 days before delivery date'
'description': '5 days before delivery date'
'description': '6 days before delivery date'
'description': '7 days before delivery date'
The $showDomainDescription query parameter
When retrieving, creating and updating fields with domain values in the RamBase API, only the key to the domain value is presented and used.
As an example, in the shipment element in sales orders there are 4 fields with domain values: DeliveryTerms, ShippingDay, ShippingAdviceConsolidationField and ShippingAdviceItemSortBy:
To include the description in GET requests, set the $showDomainDescriptions to True:
'deliveryTermsDomainDescription': 'CIF - Cost, insurance and freight',
'shippingDayDomainDescription': 'Monday week before delivery date',
'shippingAdviceConsolidationFieldDomainDescription': 'Customers reference',
'shippingAdviceItemSortByDomainDescription': 'Product name'
If specified, the description will be translated to the language provided in the $lang query parameter (if a translation is available in provided language).