Cloud Jasmin DevelopmentConcepts
DevelopmentConcepts
Concepts
Back | List of Articles

Base entities and extensions

Last changed in 26/08/2022

The concept of entity and extension entity (extensions) allows certain business entities - a company that has a business or some other type of relationship with the company managed - to assume several "roles" in the system and always be managed as a single identity.

An example of this concept can be companies that act as both customers and suppliers.

The company's common data are kept in the base entity and particular data of each of these roles are kept in the respective extensions. It is also possible to add any of the available extension to entities at any time.

Two very important examples are the Partner and the Item entities.

In the first case, the base entity is a Party, which will include the company's common data - its name, address, contacts, etc. Extensions will be CustomerParty (customer), SupplierParty (supplier), FinancialInstitution, and SalesPerson.

For items, the base entity (Item) will keep the common data - description, units, etc. - and extensions are the details necessary to manage that item in the different areas of the application: Sales, Purchases, Materials (inventory).

API

The Web API provides the necessary endpoints to manage these two types of entities. You can:

  • Create a new base entity;
  • Create a new base entity and an extension;
  • Add an extension to an existing entity;
  • Remove an extension from an existing entity.

Creating base entities

This case is similar to creating a record in any type of entity. The endpoint of the base entity (Item in the example) is used like any other (POST):

https:///api/{Account}/{Subscription}/businessCore/items

Creating base entities and extension entities

When you create an extension record, we are actually creating two records, one in the base entity and one in the extension. For this reason, we use the extension endpoint (POST):

https:///api/{Account}/{Subscription}/salesCore/salesItems

The resource used in this endpoint is actually a combination of the Item and SalesItem entities.

Adding extensions to existing entities

You can add an extension to a base entity as long as that extension does not already exist.

In order to do this, you need to pass the "baseEntityKey" (which is the record's natural key) attribute in the request body.

The endpoint will be similar to the following (POST):

https:///api/{Account}/{Subscription}/salescore/salesitems/extension
Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Quais são os endpoints da Web API? Características da Web API Primavera Formato dos pedidos e respostas Mensagens de erro Entidades base e extensões