Table 240 - Product observation policy
This article introduces the fields of the Product Observation Policy integration layout.
To better understand the concept behind this policy, we recommend reading the article Concept of Product Observation Policy. Find out how to do the Exclusion of Product Observation Policies via integration.
Layout fields
Section titled “Layout fields”| Order | Field description | Format and size | Required | Version | Note |
|---|---|---|---|---|---|
| 1 | Table identifier (IDENTIFICADOR) | Fixo=240 (3) | Yes | 5.12 | Identifies the integration layout. |
| 2 | Code (codigo) | Text (30) | Yes | 5.12 | Policy identifier in the ERP. The integration finds the record by code inside the company; reuse the same code to update the policy. |
| 3 | Product code (codProduto) | Text (30) | Yes | 5.12 | Code of the product the observation applies to. |
| 4 | Customer code (codCliente) | Integer | No | 5.12 | Restricts the policy to the informed customer. Empty: does not restrict by customer. In older versions, the customer was required. |
| 5 | Observation (observacao) | Text (TEXT) | Yes | 5.12 | Full observation text. It can contain HTML, rendered in the app. |
| 6 | Price list code (codListaPreco) | Text (30) | No | — | Restricts to the price list of the order scenario. Empty: does not restrict by list. |
| 7 | Branch code (codFilial) | Text (30) | No | — | Restricts to the order branch. Empty: does not restrict by branch. |
| 8 | Salesperson code (codVendedor) | Integer | No | — | Restricts to the order salesperson. Empty: does not restrict by salesperson. |
| 9 | Order type code (codTipoPedido) | Integer | No | — | Restricts to the informed order type. Empty: does not restrict by type. |
| 10 | Priority (prioridade) | Integer | No | — | Among policies with the same specificity, the lowest number wins. Inform it explicitly, for example 1. |
| 11 | Customer region code (codRegiaoCliente) | Integer | No | — | Restricts to the region registered on the customer. Empty: does not restrict by region. |
| 12 | Customer state (ufCliente) | Text (2) | No | — | Restricts to the state registered on the customer, for example RS. Empty: does not restrict by state. |
| 13 | Short observation (observacaoResumida) | Text (255) | No | — | Summary shown on the product; it can contain HTML, within the total limit of 255 characters. When the salesperson taps it, they open the full observations. |
The “—” mark means the layout version that introduced the field was not identified. See application compatibility below.
How the policies apply
Section titled “How the policies apply”Every filled filter must match the order scenario. An empty filter does not restrict the policy; to represent that condition in the file, keep the position empty between the separators. Do not use zero as a substitute for an empty filter.
For each product, selection follows this order:
- Selects the policies whose filters match the scenario.
- Keeps the most specific policies: those with the highest number of filled filters among customer, customer region, customer state, price list, branch, salesperson and order type. Each filter counts the same.
- Among those policies, keeps the ones with the lowest priority value.
- If there is a tie on both criteria, keeps every tied policy, ordered by the most recent internal identifier first.
For example, a policy with customer and branch filled wins over another with only the customer, even if the second has a lower priority number. Priority breaks the tie between policies with the same number of filled filters.
In the Demander app, the full observations of the selected policies are joined, separated by line breaks. The preview uses the first non-empty summary in the selection order. If no summary is filled, it uses the full content.
The database sets default priority 1 when the record is created. That default does not guarantee that an empty field sent by the importer is converted to 1. Inform the priority explicitly to get a predictable selection.
Compatibility
Section titled “Compatibility”The product API of the order screen applies the selection with the new filters for Android from version code 50290000 and iOS from 4030. For the Web platform, it applies this selection when the request informs a valid numeric version.
On earlier versions served by this API, the query considers only product and customer and returns one observation per product, without the new filters, the priority or the summary. Update the apps before using general policies or scenarios with the new filters.
Record examples
Section titled “Record examples”Policy specific to one customer, with the other filters empty:
240|OBS001|54|1234|<p>Conferir embalagem antes do envio.</p>|||||1|||Conferir embalagemPolicy for any customer, restricted to list LP01, branch F01, salesperson 25, order type 2, region 10 and state RS:
240|OBS002|54||<p>Condição comercial especial para esta região.</p>|LP01|F01|25|2|1|10|RS|Condição comercial especialEach example has 13 positions, including the identifier 240. Keep the order and the empty fields; the policy internal identifier, the company and the dates are managed by Demander and are not part of this layout.