Entities
At the core of OData are feeds, which are Collections of typed Entries. Each entry represents a structured record with a key that has a list of Properties of primitive or complex types. Entries can be part of a type hierarchy and may have related entries and related feeds through Links. For example the following URI represents a feed of Product entries: https://restdev.erp.bg/rest/General_Products_Products.
The central concepts in the EDM are entities and associations. Entities are instances of Entity Types (for example, Customer, Employee, and so on) which are structured records consisting of named and typed properties and with a key. Complex Types are structured types also consisting of a list of properties but with no key, and thus can only exist as a property of a containing entity or as a temporary value. An Entity Key is formed from a subset of properties of the Entity Type. The Entity Key (for example, CustomerId or OrderId) is a fundamental concept for uniquely identifying instances of Entity Types and allowing Entity Type instances to participate in relationships. Entities are grouped in Entity Sets (for example, Customers is a set of Customer Entity Type instances).
This API Reference represents all EnterpriseOne entities and their properties.
The technical documentation of EnterpriseOne can be faund in https://enterpriseone.atlassian.net/wiki/display/techdoc/
$filter restrictions
EnterpriseOne REST API supports a subset of odata filter operators and functions:
Not every property supports all of this filter operators and functions. If the property doesn't support the specified operator an exception is thrown.
Only 'and' operator is supported. 'or' is not supported.
A multiple 'eq' operators can be used with 'and' operator for the same property. The effect is as if 'or' is used.
Example of complex query that loads products from several product groups and filters the name:
General_Products_Products?$expand=MeasurementUnit,ProductGroup,MeasurementUnit/MeasurementCategory&$filter=ProductGroupId eq guid'57d4c91c-dbf5-48f1-84f3-432092463d3d' and ProductGroupId eq guid'a7c4c91c-dbf5-48f1-84f3-43209246dd3d' and substringof('search',Name)
Numeric properties
The OData standard requires the numeric values to be specified in quotes in POST, PUT and PATCH bodies.
{
"Quantity": "2.763"
}
Multi-language strings - https://enterpriseone.atlassian.net/wiki/display/techdoc/Multi-language
Some text properties support value in more than one language. This properties are of multi-language string type.
Example: General_Products_Products.Name property.
The multi-language string can store many language strings, indexing them by language key. The language key is a CultureInfo two letter ISO language name, like "en", "de", etc.
In EnterpriseOne REST API the multi-language properties are displayed as two separed properties.
One displayed in the current language of the session and the other with values dor all supported languages.
For example the Name property of General_Products_Products entity is displayed as (current language is bulgarian):
{
"Name": "Ябълка",
"NameMultilang": {
"__metadata": {
"type": "EnterpriseOne.MultilanguageString"
},
"bg": "Ябълка",
"en": "Apple",
"pt": null,
"ru": null,
"mk": null,
"pl": null,
"it": null,
"sr": null,
"fr": null,
"de": null,
"hu": null,
"cs": null,
"el": null,
"ro": null,
"es": null
},
}
The NameMultilang property can be used to set values in many languages at once in PATCH/UPDATE or POST/CREATE request.
PATCH General_Products_Products(guid'2736521d-0b79-4a73-9a22-08ee71a54a9e')
{
"NameMultilang": {
"en": "English Name",
"bg": "Име на български"
}
}
Custom Properties
User-defined properties, which can supplement the system properties of almost all entities in the system.
Custom properties are defined in General_CustomProperties.
EntityName specifies the entity for which the property is applicable.
Table of EntityName -> REST API Resource Name corespondences
Custom properties can be free text property or restricted to a list of allowed values. This is specified by LimitToAllowedValues property.
AllowedValuesEntityName specifies that the allowed values are retrieved from the specified entity. If null the allowed values are retrieved from General_CustomPropertyAllowedValues
In EnterpriseOne REST API custom properties are represented as open-type string properties. The code of the custom property is used as a property name in the JSON result. Only custom properties which code matches the regular expression ([_a-zA-Z][_a-zA-Z0-9]*) are shown in the JSON result. That means that the property code must start with underscore or a latin letter and must contain only latin letters, digits or underscore.
The custom property values are returned in the result along with the system properties.
Example:
{
"Name": "Lenovo Thinkpad T430s 3rd gen Core i5 2.60GHZ 4GB RAM 128GB SSD Win 7 Pro Webcam",
"Comp_Brand": "{\"Value\":\"LENOVO\",\"Description\":null,\"DescriptionMultilang\":null,\"ValueId\":null}",
"Comp_HDD_Size": "{\"Value\":\"320\",\"Description\":null,\"DescriptionMultilang\":null,\"ValueId\":null}",
"Comp_RAM_Size": "{\"Value\":\"2\",\"Description\":null,\"DescriptionMultilang\":null,\"ValueId\":null}",
"Comp_Screen_Size": "{\"Value\":\"15\",\"Description\":null,\"DescriptionMultilang\":null,\"ValueId\":null}",
}
Properties "Comp_..." are custom properties.
The value of the custom property is a JSON object with properties Value, Description, DescriptionMultilang and ValueId.
The actual value is stored in General_PropertyValues
For POST/CREATE and PATCH/UPDATE requests only the property value can be specified:
PATCH General_Products_Products(guid'2736521d-0b79-4a73-9a22-08ee71a54a9e')
{
"Comp_Brand": "Lenovo"
}
Or the full property value object:
PATCH General_Products_Products(guid'2736521d-0b79-4a73-9a22-08ee71a54a9e')
{
"Comp_Brand": "{\"Value\":\"LENOVO\",\"Description\":\"Lenovo Description\",\"ValueId\":null}",
}
Using multi-language:
PATCH General_Products_Products(guid'2736521d-0b79-4a73-9a22-08ee71a54a9e')
{
"Comp_Brand": "{\"Value\":\"LENOVO\",\"DescriptionMultilang\":{\"en\":\"Lenovo Description\", \"bg\":\"Описания на Леново\"},\"ValueId\":null}",
}