Working with data

The definition of the model consists of Api name, model name and field (including nested fields) name(s) separated by dot “.”: {ApiName}.{ObjName}.{Field}, e.g: ErplyApi.Customer.FullName or ErplyApi.Customer.Address.City, where ErplyApi is name of the API, Customer - name of the model and rest is the field or if this is struct, then with nested fields.

  • If definition used as template data (wrapped into {{}}), then it should have prefix .Data, e.g. {{ .Data.ErplyApi.Customer.FullName }}
  • If definition used in the form input names, then omit .Data prefix, e.g. <input name="ErplyApi.Customer.FullName">

Each model name should have specific suffix which describes the scope where it is used:

  • Query (e.g. CustomerQuery) represents query model, usually used in search forms and submitted as a GET request
  • Input(optional) (e.g. CustomerInput) represents the input model, mostly used in forms during create or update actions. It is optional, an entity considered as an input object if there is no suffix specified. Input models can be used in form input names and optionally in values as data sets. One API entity may have multiple Input models.
  • Dto (e.g. CustomerDto) represents a data transfer object, usually it consists of one or many entities from different APIs. May be used in previews or tables.
  • List (e.g. CurrencyList) represents the list of simple entities, usually used for populating dropdowns.
  • DtoList (e.g. CustomerDtoList) is a list of Dto’s