How to create related information panels based on a query?
This document describes the steps necessary for creating related information panels for the PRIMAVERA ERP. Related information panels allow you to load user-created controls to extend an entity's information. This type of control is especially useful in supporting decision making by presenting content related to the user's current context. Additionally, related information panels are linked to categories (Customers, Suppliers, Items, etc.) when invoking the 'F4' action in the ERP, and therefore are displayed only when these categories are selected or invoked. You can enable/disable the automatic opening of related information panels through the Related Information context option. Closing the panel manually disables this option. There are already three types of components available from PRIMAVERA that can be reused to build panels. These are: Step 1 - Register the panel The related information panels are registered in the Related Information tables of the database, which saves the panel's definition and data source, and in the Relational Information Contexts table, which saves the location where the panel is executed. Table of Related Information: TypeClassName: Name of the control that will be included in the Panel (CI_Lista, CI_Registo, etc.) An example of a component for checking stock availability is given below. The CI_Lista component is used, the source of the data is a table query: ArtigoArmazem. Note that the two display modes (Chart or Table) associated with the CI_Lista component are independent and optional. For this reason, the chart display depends on the status of the Visible attribute associated to the Graph tag, which means you only need to assign a zero value to the Visible attribute if you do not want to view data as a graph. Step 2 - Associate the panel with the context After defining the component, it must be associated with one or several contexts (ERP views). To do this, enter the information in the ContextosInformacaoRelacionada table. The following shows the SQL code that links the previously defined component to the item maintenance view/form. Note: To know the name of the category of information and form, use the ERP diagnostic panel. To activate this panel, edit the Config.ini file in the ERP's Config folder and add this section: [Diag] Completo = 1 Destino = 2Types of components
Creating related information panels
Fields Description ID Component identifier (which will be used later to associate with a screen/form). Categoria Information category that identifies the entity to which the component is associated, e.g. 'Item' Config Component parameterization. The main elements of this configuration are the place where the name of the component that will be included in the panel should be placed, which will feed the table and corresponding chart, and the definition of the table columns.
SqlQuery: The SQL query that will feed the table and corresponding chart.
Grid: Definition of the table columns
Each component is associated with a type of entity through the corresponding Category. In this case, the Category is 'Item'.INSERT INTO [dbo].[InformacaoRelacionada]
([Id]
,[Categoria]
,[Config])
VALUES
('65336A27-A96B-4CD2-8ED7-70AD00539888',
'Artigo',
'
PriCloudLibrary900.CI_Lista
Exemplo: DisponibilidadesStock
Disponibilidades de Stock
0
2000
SELECT AA.Armazem,AA.Localizacao,AA.StkActual,AA.QtReservada,AA.QtTransito
FROM dbo.ArtigoArmazem AA
WHERE AA.Artigo= ''@@Entidade@@'' AND AA.StkActual > 0
0
1
1
Armazem
Localizacao
StkActual
1
QtReservada
QtTransito
0
'
)
Field Description IdCategoria Identifier of the previously created component Contexto The logical name of the ERP Form where the component must be displayed Ordem Position in which the component must appear if there are other components for the same Form and Category. Params List of parameters to transfer from the Form to the Component. Typically there is only a @CHAVE@ parameter, which contains the primary key of the applicable entity and that will be used directly in the SQL query (ie: CHAVE@ = @@Entity@@ = Entity Code) INSERT INTO [dbo].[ContextosInformacaoRelacionada]
([IdCategoria]
,[Contexto]
,[Ordem]
,[Params])
VALUES
('65336A27-A96B-4CD2-8ED7-70AD00539888'
,'frmTabArtigos'
,2
,
'
1
Entidade
@CHAVE@
')
login para deixar a sua opinião.