V10 ResourcesGuides
ResourcesGuides
Guides
Back | List of Articles

How to create related information panels based on a query?

Last changed in 02/12/2020

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.

Types of components

There are already three types of components available from PRIMAVERA that can be reused to build panels. These are:

  • CI_Registo: allows you to display a list of attributes for a certain entity. This component is ready to display attributes of various types, such as: text, numerical values, dates, images, etc.
  • CI_Lista: allows you to display a table of data.
  • CI_Lista(Gráfico): allows you to display a table of data in graphic form.

 width=

Creating related information panels

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:

FieldsDescription
IDComponent identifier (which will be used later to associate with a screen/form).
CategoriaInformation category that identifies the entity to which the component is associated, e.g. 'Item'
ConfigComponent 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.

TypeClassName: Name of the control that will be included in the Panel (CI_Lista, CI_Registo, etc.)
SqlQuery: The SQL query that will feed the table and corresponding chart.
Grid: Definition of the table columns

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.
Each component is associated with a type of entity through the corresponding Category. In this case, the Category is 'Item'.

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.

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
	  
	'
	           
	)

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.

FieldDescription
IdCategoriaIdentifier of the previously created component
ContextoThe logical name of the ERP Form where the component must be displayed
OrdemPosition in which the component must appear if there are other components for the same Form and Category.
ParamsList 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)

The following shows the SQL code that links the previously defined component to the item maintenance view/form.

INSERT INTO [dbo].[ContextosInformacaoRelacionada]
([IdCategoria]
,[Contexto]
,[Ordem]
,[Params])
VALUES
('65336A27-A96B-4CD2-8ED7-70AD00539888'
,'frmTabArtigos'
,2
,
'

1



Entidade
@CHAVE@


')

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 = 2

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!
Related Articles
Getting Started How to create an integration project with Visual Studio? How to create an Interface Extensibility Project (PEX) with Visual Studio? How to create an API (Engine) extensibility project with Visual Studio? How to create user tabs with Visual Studio?