Characteristics of entities and services
In the PRIMAVERA ERP, entities and services have a set of transversal characteristics that implement uniform behaviors, influencing the way entities are treated or services respond. The main characteristics of entities and services are described below. All entities that support transactions (Purchase, Sales or Accounting Documents, etc.) in the system have a unique identifier automatically generated by the platform. This is a GUID (Global Unique Identifier). The identifier must be used in API services that support the selection of a record by its ID. Example of how to generate an ID with the platform: Example of editing a record by ID. The EmModoEdicao attribute is present in all system entities and is used by the platform to know when to update or create a record in the database. When using the Edita or EditaID method, this attribute is automatically set to true. The CamposUtil attribute (StdBECampos) allows access to the collection of user fields of the entity. These fields represent extra entity characteristics and are used to store additional data specific to an implementation. // Add a row to the sales document. // Retrieve the first row from the document. // Assign the value to the 'LinVar1' CDU in the first row of the invoice. All classes provide a set of standard services that allow you to perform a set of operations on the entities.Unique identifier
PSO.FuncoesGlobais.CriaGuid(false);
BSO.Vendas.DocumentosVenda.EditaID('C73C6FD7-61E4-4DCA-B441-32C3DD94A336');
In edit mode
User Fields
VndBELinhaDocumentoVenda linha = new VndBELinhaDocumentoVenda();
double qtd = Convert.ToDouble(item.SubItems[1].Text);
PSO.Vendas.Documentos.AdicionaLinha(invoice, item.SubItems[0].Text, ref qtd);
linha = invoice.Linhas.GetEdita(1);
linha.CamposUtil['CDU_LinVar1'].Valor = '100';Standard services
Attribute | Description |
---|---|
Actualiza | Add or update a new entity |
ActualizaValorAtributo | Update the value of an attribute for an existing entity |
ActualizaValorAtributos | Update the value of several attributes for an existing entity |
DaValorAtributo | Returns the value of an attribute for an existing entity without locking the record |
DaValorAtributos | Returns the value of several attributes for an existing entity without locking the record |
DaValorAtributoLock | Returns the value of an attribute for an existing entity and locks the record |
DaValorAtributosLock | Returns the value of several attributes for an existing entity and locks the record |
Edita | Returns an existing entity |
Existe | Checks whether a specific entity exists |
Remove | Removes an entity from the system (as applicable) |
ValidaActualizacao | Checks whether an entity can be updated |
login para deixar a sua opinião.