Escolar Documentos
Profissional Documentos
Cultura Documentos
Version 1.0
March 2013
Content
Content .............................................................................................................................. 2
Introduction ....................................................................................................................... 6
Extensibility ....................................................................................................................... 7
Application Engines .........................................................................................................7
Platform Engines .............................................................................................................7
VBA Visual Basic for Applications ..................................................................................8
User Fields and Tables .....................................................................................................8
User Tabs and Forms .......................................................................................................8
User Functions .................................................................................................................8
User Processes ................................................................................................................9
User Menus ......................................................................................................................9
Navigator ........................................................................................................................9
Lists ................................................................................................................................9
User Maps ......................................................................................................................10
Integration Technologies ...............................................................................................10
Module Engines ................................................................................................................ 12
COM Technology and Windows DNA Architecture ...........................................................12
Engine Architecture .......................................................................................................13
Business Objects (BE) ....................................................................................................14
Business Services (BS) ..................................................................................................15
Data Services (DS).........................................................................................................17
Use of Engines in External Applications ..........................................................................18
Integration of the Engine in the Project ............................................................................. 18
Opening the Engine ........................................................................................................ 19
Customer Creation ......................................................................................................... 20
Platform Engines .............................................................................................................. 22
PRIMAVERA Administrator .............................................................................................22
References .................................................................................................................... 22
Opening the Engine and Execution of the Service .......................................................... 23
Platform Services (StdPlatBS)........................................................................................24
References .................................................................................................................... 24
Service Execution .......................................................................................................... 24
Pg 2
Pg 3
Pg 4
Pg 5
Introduction
The Extensibility of applications is a central concept in ERP PRIMAVERA in that it allows the standard
solution to be supplemented with additional features and to intervene in the core features of each application
to meet the specific needs of each business or customer in particular.
The objective of this manual is to document - within the context of the PRIMAVERA Partners - the most
important ERP PRIMAVERA extensibility tools, presenting their conceptual architecture, practical examples of
their application and the competitive advantages they are able to provide.
The information presented refers to PRIMAVERA Platform version 8.10 and PRIMAVERA EXECUTIVE
version 8.10.
In order to see the most up to date version of this manual, we suggest you check online in PRIMAVERA
KnowledgeBase.
PKB
Extensibility Manual
Pg 6
Extensibility
The concept of Extensibility refers to the ability to alter and extend the features of the various ERP
PRIMAVERA modules and applications, adapting them to the specific needs of each particular
customer/business/implementation.
Considering that PRIMAVERA is a company specialized in the development of standard management
solutions (directed essentially at the administrative and financial areas of organizations) it is, nonetheless,
necessary for its products - and its EXECUTIVE solutions in particular - to increasingly incorporate
extensibility technologies.
Over the course of time and evolution of PRIMAVERA products there have been several technologies that
were developed and exploited and are today a very powerful tool at the disposal of the implementation
services of PRIMAVERA and its partners. These technologies permit, for example:
The reuse of code and the most common features that a programmer needs and
that the PRIMAVERA platform provides;
The intervention and adaptation of the behavior of the main ERP features;
The extension of the database or the data exploration tools provided by the ERP;
Application Engines
All PRIMAVERA applications are developed in accordance with the Windows DNA architecture and
internationally recognized standards of components development through layers, provided through DLLs
COM.
This architecture permits the reuse of all the main features of the applications (the business rules) from any
other external application such as Microsoft Excel.
Platform Engines
The PRIMAVERA Platform consists of a set of components that provide the most core features (example:
map printing or exporting of records) of the ERP and the common features among all modules (example: the
link to the database or the permissions system).
Pg 7
Although these components were specifically conceived to be consumed by PRIMAVERA applications, many
of their features are also exposed for any external application through components (engines) that may be
reused, reducing the development effort involved in implementation.
User Functions
A User Function (XDU) corresponds to the definition of an action - among the various types of actions
available (sending messages, exporting maps, execution of VBA macros, etc.) - that can interact with the user
(through the request for parameters and the presentation of results) and the system (VBA, engines, etc.) to
automate a particular task.
Given its characteristics, the User Functions are the central component of the 2nd Generation extensibility
technologies (provided as from version 3 of the Corporate Line) and are used for the implementation of
several other tools such as User Processes and User Menus.
Pg 8
User Processes
User Processes (PDU) permit the graphic definition of workflows (sequences of User Functions merged into
one another) that facilitate the automation of repetitive processes (examples: automatic orders or processing
of bonuses) and their integration in the ERP to implement specific needs of each implementation.
User Menus
The User Menus allow the application menus to be supplemented through the inclusion of new options that
will execute a specific User Function (which, for example, opens an external application or initiates a particular
background operation).
Navigator
In this version the Browser had suffer a major restructuration.
The Navigator is the "entry point" for all modules and provides users with a central point from which to access
all the application features (lists, menu options, documents, shortcuts, etc.) configured according to their
preferences and permissions.
From the implementation viewpoint, the Navigator is also a powerful configuration tool because it allows:
Lists
One of the most important components in the implementation of an integrated management solution is related
with the data exploration tools managed in the system and their adaptation to the needs of each user.
Since the first version of the PRIMAVERA applications, lists provide the primary method to access the main
data (the client, sales document, current account lists, etc.).
As from version 3 of the Corporate Line, the ERP PRIMAVERA includes a powerful assisted configuration
system of lists through information categories that relate all the tables in the database and allow the user to,
among other functions:
Define the fields of each table that must be presented for each list;
Pg 9
Define filters and conditions to restrict the results and adapt them to the needs of
each user;
Create dynamic and parameterized lists that present different data according to the
conditions selected by the user at execution time.
User Maps
The PRIMAVERA applications provide all maps (printings) through the use of Crystal Reports.
This tool - clearly an international standard at this level - allows the various maps of the application to be
adapted (or new maps created) in accordance with the business rules of each implementation.
The PRIMAVERA Partners perform an indispensable role in PRIMAVERAS business. The acknowledgement
of that role - in the complementary solutions that they offer final clients as well as implementation services resulted in the availability, by PRIMAVERA, of technologies that facilitate the integration of its solutions with
standard solutions.
At this moment the following integration technologies are available:
Integration Technologies
The PRIMAVERA Partners perform an indispensable role in PRIMAVERAS business. The acknowledgement
of that role - in the complementary solutions that they offer final clients as well as implementation services resulted in the availability, by PRIMAVERA, of technologies that facilitate the integration of its solutions with
standard solutions.
At this moment the following integration technologies are available:
Pg 10
Pg 11
Module Engines
COM Technology and Windows DNA Architecture
All PRIMAVERA applications are developed based on COM technology and the Windows DNA architecture.
This architecture model in 3 levels, allows the provision of access to the intermediate layer through different
interfaces and in a way that does not allow the logic inherent to the operation of the applications to be
subverted.
This layer is composed by a set of components (routines), which make up about 70% of the code of a product,
also known as "Rules of the Business". This is a part of the application, whose code is very likely to withstand
the constant mutations of technology.
The access to information from the interface through the business objects model guarantees the fulfilment of
the business rules established in ERP PRIMAVERA as well as independence in relation to the data model.
This fact constitutes the fundamental element of the PRIMAVERA Integration Technology (TIP).
On the other hand, the use of this technology allows different objects to be shared by different applications
within ERP PRIMAVERA. For example, the access to the Movements window of the Accounting module
directly from the Sales/Orders Editor of the Sales module.
Pg 12
This possibility exists not only among the various ERP modules, but also in external applications that can use
the different Application Engines. For example, the access from Microsoft Excel or an application developed
by the user to the saving of movements in the Accounting module or invoices in the Sales module
Engine Architecture
Conceptually, the architecture of the ERP PRIMAVERA engine, structured in three layers, isolates the access
to the data, enabling its reuse by external applications without compromising the integrity of the data.
The engine of an application is composed by a set of DLLs COM that may be referenced and used from
external applications, provided they are registered in the system and included in the respective project.
User
Interface
AplUS800.dll
Business
Services
ErpBS800.dll
IAplBS800.dll
AplBE800.dll
AplBS800.dll
Data
Services
ERPDS800.dll
IAplDS800.dll
AplBE800.dll
AplDS800.dll
Data Structure
Pg 13
The previous diagram presents the architecture and organization of the engine of one or more modules that
will be composed by the following DLLs:
AplBE800.dll
Business objects.
Represent the entitites managed by the engine and the application.
ErpBS800.dll
IAplBS800.dll 1
AplBS800.dll 1
Business Services.
Provide all the business rules.
IAplDS800.dll 1
AplDS800.dll
Data Services.
Provide all the data loading and saving services from the database.
GcpBEDocumentoVenda
GcpBEDocumentoCompra
RhpBEFuncionario
CblBEConta
(Accounting Area)
As an example, in the case of a Sales Document, the programmer will have access to an object type
GcpBEDocumentoVenda that is composed by a header (with several properties) and a set of details (for
example: the document lines).
The abbreviation Apl must be substituted by the nomenclature associated with each
module/area. Therefore, for example, for the Logistics & Treasury area it must be IGcpBS800,
GcpBE800,...
Pg 14
Each object will have a set of properties that basically correspond to the fields used in the database to store
the entity:
Anulado (Annulled)
Arredondamento (Rounding)
()
Using this component to, for example, create a new client using the Logistics & Treasury area engine, we can
guarantee that the creation of that entity will observe all the business rules required by PRIMAVERA
applications (example: validations).
Each engine service is provided through a class that can be accessed through the main class of the engine
(ErpBS). The nomenclature of those services is as follows:
I<Apl>BS<Name>
Examples:
Pg 15
IGcpBSClientes
IRhpBSFuncionarios
ICblBSDiarios
(Accounting Area)
In the case of the Logistics & Treasury area engine the services tree is similar to the following:
Each one of the service classes implements a set of typical methods that carry out the most important
operations regarding each entity type:
Actualiza
ActualizaValorAtributo
ActualizaValorAtributo
s
DaValorAtributo
DaValorAtributos
Edita
Existe
Remove
Pg 16
ValidaActualizacao
ValidaRemocao
As an example, let us consider the signature of these methods for the Client services of the Logistics &
Treasury area:
Private Sub IGcpBSClientes_Actualiza(ByVal BECliente As GcpBECliente)
Private Sub IGcpBSClientes_ActualizaValorAtributo(ByVal strCliente As String, ByVal
strAtributo As String, ByVal varValor As Variant)
Private Sub IGcpBSClientes_ActualizaValorAtributos(ByVal strCliente As String, ByRef
Atributos As StdBECampos)
Private Function IGcpBSClientes_DaValorAtributo(ByVal strCliente As String, ByVal
strAtributo As String) As Variant
Private Function IGcpBSClientes_DaValorAtributos(ByVal strCliente As String, ParamArray
Atributos() As Variant) As StdBECampos
Private Function IGcpBSClientes_Edita(ByVal strCliente As String) As GcpBECliente
Private Function IGcpBSClientes_Existe(ByVal strCliente As String) As Boolean
Private Sub IGcpBSClientes_Remove(ByVal strCliente As String)
Private Function IGcpBSClientes_ValidaActualizacao(ByVal BECliente As GcpBECliente,
ByRef StrErro As String) As Boolean
Private Function IGcpBSClientes_ValidaRemocao(ByVal strCliente As String, ByRef StrErro
As String) As Boolean
Pg 17
Warning
This application engine component must never be referenced from external applications. Its services must always be executed
through the business layer (ErpBS).
The client possesses an external CRM system where the company's potential clients are recorded;
The objective is to use the Logistics & Treasury area engine to record in ERP PRIMAVERA the
clients managed in an external CRM system, when these carry out their first order.
The example presented below was developed in Visual Basic 6 for two reasons:
1) Because it is the preferred development tool used by PRIMAVERA;
2) Because it includes features that simplify the integration of COM components.
Note, however, that the PRIMAVERA engine components can be used in other programming environments. All the most recent
programming languages include features that permit COM components to be referenced in a relatively simple manner.
Pg 18
Pg 19
CodEmp
Utilizador
Password
User password.
Transaccao
Instancia
ModoPrimario
Customer Creation
In the case of saving a new customer it will be necessary to fill in an object type GcpBECliente and execute
the Update method of IGcpBSCliente:
Private Sub cmdSincro_Click()
Dim objMotorErp
As ErpBS
Dim objCliente As GcpBECliente
Dim objClienteCRM
As Cliente
Pg 20
.ModoPag = objClienteCRM.ModoPag
.CondPag = objClienteCRM.CondPag
.Moeda = objClienteCRM.Moeda
End With
'Gravao
objMotorErp.Comercial.Clientes.Actualiza objCliente
Set objCliente = Nothing
'Fecho do motor
objMotorErp.FechaEmpresaTrabalho
Set objMotorErp = Nothing
Exit Sub
Erro:
If Not (objCliente Is Nothing) Then Set objCliente = Nothing
If Not (objMotorErp Is Nothing) Then
objMotorErp.FechaEmpresaTrabalho
Set objMotorErp = Nothing
End If
MsgBox "Erro ao efectuar a sincronizao." & vbCrLf & Err.Description, vbExclamation
End Sub
PKB
Engines Documentation
Pg 21
Platform Engines
The PRIMAVERA Platform consists of a set of components, used by all PRIMAVERA applications, which
provide core and common features among all applications, such as for example:
Printing of maps;
Control formatting;
Transaction treatment;
Backup;
Database management;
Etc.
PRIMAVERA Administrator
The PRIMAVERA Administrator - the general system administration application, of the companies recorded in
the system and of security - is an integral part of the PRIMAVERA Platform.
The Administrator features are presented via two distinct and complementary engines:
AdmEngine800.dll old version of the engine according to the first generation of the PRIMAVERA
Integration Technology;
AdmBS800.dll new version of the Administrator engine that follows the same architecture
described for the ERP engines.
Warning
The AdmEngine engine, in spite of providing features that are not yet available in the new engine, has had its development
discontinued. It shall be completely substituted in time by the new engine version and its use is therefore not recommended.
The use of the Administrator engine is basically identical to that described for the ERP engine. Let us consider
the following example:
References
Pg 22
As AdmBEEmpresas
Dim objEmpresa
As AdmBEEmpresa
Pg 23
These services are available from the PRIMAVERA applications - in the VBA development environment
(PRIMAVERAPlatform) - but can also be used from an external application. One of the most common
examples of this practical application is the printing of maps.
References
Service Execution
Private Sub cmdPrint_Click()
Dim objPlat
As StdPlatBS
Dim objConfApl
As StdBSConfApl
Dim strFormula
As String
Dim strSelFormula
As String
Pg 24
Pg 25
PKB
Engines Documentation
Access to the actual objects maintained and manipulated in the context of each of the main
operations - customer maintenance, sales editors, etc.;
Association of code to certain events triggered by the most important application operations;
Creation of user tabs for editing user fields associated to each entity;
Integration of developments made to the PRIMAVERA solution, via User Functions which can be
associated to the Navigator or User Menus.
IDE
The IDE (Integrated Development Environment) of the VBA is a window that appears to the user separately
from the main window of the associated application.
All VBA development tools can be accessed from the IDE, including the "Project Explorer", "Object Browser",
code editor, form design interface and debugger.
Pg 26
Proprerties
Project Explorer
Form Design
Interface
Object Browser
VB Code Editor
Pg 27
VBA Project
The VBA projects perform two fundamental roles. First, they contain the project items. Second, they store all
the VBA code.
A VBA project can consist of:
The ERP PRIMAVERA v8.10 provides a single VBA project that aggregates all the classes of all the modules that
support VBA. Regardless of the Modules that are available in the ERP, there is only one project that provides all the
features.
Macros
A macro corresponds to a public VBA subroutine without any parameters. Macros must be defined in "Class
Modules" and serve as an entry point to a certain feature provided by the project.
The IDE of the VBA provides a specific dialogue to assist the user in manipulating this type of VBA code.
Pg 28
This dialogue enumerates all the available macros in a project, allowing their editing, removal or execution by
the user.
PKB
Classes
All VBA projects associated to the PRIMAVERA applications provide a grass-roots set of classes enabling the
extension of the main features of the application.
These classes can be recognized in the VBA "explorer" under the first node:
Pg 29
Files (ex.: FichaArtigos): are associated to the maintenance of the main application
tables;
Events
Conceptually, an event corresponds to an action recognized by one of the project objects - for example,
pressing a key or selecting a button and for which a code can be produced as an answer. An event can be
triggered by the system as a result of an action by the user or from code.
The VBA project provides a set of system events associated to each class previously described. These events
are the starting point for customizing the solution provided by PRIMAVERA.
The following examples illustrate the potential use of system events to change application behavior:
When an article is identified in the lines of a sales document, the respective event
can implement additional business rules not implemented in the Logistics &
Treasury area.
AntesDeAnular
AntesDeEditar
AntesDeGravar
DepoisDeAnular
DepoisDeEditar
Pg 30
DepoisDeGravar
TeclaPressionada
AntesDeCriar
Example:
Editors
The events provided in document editing or processing operations depend on each particular case.
As an example, the EditorVendas class (associated to the sales documents editing form of the Sales Module)
provides the following events:
AntesDeAnular
Before
Antes de
canceling
iniciar aaanulao
document.
do documento.
AntesDeDuplicar
AntesDeEditar
AntesDeGravar
AntesDeImprimir
Pg 31
AntesDeIntegrar
AntesDeProcessar
ArmazemIdentificado
ArtigoInexistente
ArtigoIdentificado
ClienteIdentificado
DepoisDeAnular
DepoisDeDuplicar
DepoisDeEditar
DepoisDeGravar
DepoisDeImprimir
DepoisDeIntegrar
DespoisDeTransforma
r
LinhaEspIdentificada
ObraIdentificada
TeclaPressionada
ValidaLinha
ErroAoGravar
TipoDocumentoIdentifi
cado
Objects
The VBA project also provides objects allowing the access and manipulation of data associated to the
respective form/feature in each system class, in addition to the respective events.
These objects can be accessed by using the identifier Me:
Pg 32
Aplicacao
The Aplicacao object provides a set of properties related to the application associated to the VBA project:
MotorERP
Application engine.
DescricaoVersao
Empresa
Instancia
TipoPlataforma
Utilizador
VBA
VersaoVBA
VBA version.
Pg 33
PlataformaPRIMAVERA
The main features of the PRIMAVERA Platform and its engine (see StdPlatBS) are provided by this object.
This is a subset of the same methods used by the applications to:
Etc.
Pg 34
PKB
Pg 35
Pg 36
Immediately after the installation of the PRIMAVERA system, user fields in the main entities (articles, customers,
suppliers, etc.) become available.
Pg 37
Pg 38
Ateno
User field names must start with the CDU_ prefix to be correctly recognized by the system.
Pg 39
Pg 40
Pg 41
In any of the previous cases, the editing of the user fields can be modified, according to the needs of the user, through
the creation of User Tabs and the association of VBA code to implement more complex business rules.
Pg 42
User Tables
The user tables, similar to User Fields, enable the extension of a PRIMAVERA database to support the
maintenance of additional data - other entities - not provided by the standard solution.
A User Table is a set of User Fields not associated to any of the system tables.
To create a new TDU you must use the same assistant available in the Administrator, indicating the table
name, the user fields provided and the applications in which the new table will be available.
Ateno
User table names must begin with the prefix TDU_ to be correctly recognized by the system.
After creating a user table in a PRIMAVERA database, provided the mentioned rules are followed, it will
become immediately available in the respective applications and can be accessed through the "User Tables"
option in the "Tools" menu.
PKB
User Fields
User Tables
Pg 43
Select the "User Tabs" option from the "Tools" menu of the ERP where you wish to create the user tab.
The VBA development environment will be opened to assist you in editing the tab (if it is not visible the
PRIMAVERA tools bar must make it visible):
Pg 44
2.
Select the entity for which you wish to create the tab. In the context menu, select "New" (in this example
we chose the entity "Tables - Customers"). A new empty form will be created:
Pg 45
3.
4.
Design the tab, by adding user fields associated to the entity and other controls:
Pg 46
The VBA environment allows you to add any licensed control from third parties (manufacturers of controls for VBA).
There are control indices available on the Web. Controls can be found in these Web sites to carry out virtually any type of
operation in your user tabs.
5.
Pode, de seguida, introduzir cdigo especfico para implementar regras de negcio especficas: You
can then introduce specific code to implement specific business rules:
The PRIMAVERA solution provides the VBA environment configured to support the PRIMAVERA logical entities (user
fields, user tabs, etc.).
In the same way, in each tab, various events are provided that allow you to programme the operation of the tab in a
simplified manner.
6.
Pg 47
As from this moment, if you open the modified maintenance, the created user tab will open instead of the
standard tab.
User Forms
User Forms (FDU) correspond to forms developed within the scope of the VBA project associated to each
application.
In contrast to User Tabs, they are not associated to any system tables and can therefore be used to
implement other features, such as for example:
Editing tables stored in databases that are external to the PRIMAVERA system;
In practice, an FDU corresponds directly to a VBA "User Form". However, this concept allows the extension of
the PRIMAVERA solution in a more integrated manner, given that it is possible to associate each FDU to a
user function and, in this way, present the form to the user:
From the VBA project using the objects provided by the PRIMAVERA Platform.
Select the "User Forms" option from the "Tools" menu of the ERP. The VBA development environment
will be opened to assist you in editing the form;
2.
Activate the "Forms" toolbar. In the context menu, select "New Form". A new empty form will be created:
Pg 48
3.
4.
Pg 49
5.
You can then introduce specific code to implement specific business rules:
Pg 50
6.
As from this moment, the new form is available to be associated to a User Function.
PKB
User Tabs
User Forms
User Functions
A User Function (XDU) corresponds to a certain action - carried out by the PRIMAVERA system to
implement a certain business rule.
This new concept - central in the applications as from version 6.0 - allows extending the PRIMAVERA solution
to guarantee all the business rules specific to each company. For example:
SMS
Aplicao Externa
Macro VBA
Formulrio do Utilizador
Mapa do Utilizador
Pg 51
Stored Procedure
Query SQL
Depending upon its type, each User Function allows the definition of:
The following topics analyze the creation of each of the types of available user functions, definition of
parameters and their results, as well as their execution in PRIMAVERA applications.
The concept of User Functions serves as a base for the implementation of User Menus and Processes.
Select the "User Functions" option from the "Tools" menu in the ERP;
2.
The following window presents all the available user functions in the system. Select "New...":
Pg 52
3.
Na janela seguinte pode definir as propriedades da funo do utilizador. Na primeira pgina introduza o
nome da funo, seleccione o tipo E-mail e introduza uma descrio mais detalhada.
Field
Name
Type of Function
Active
Description
Function Name
Function Type
When active, the function can be executed
Pg 53
4.
Field
To
Subject
Message
Attachments
5.
Description
Message Destination
Message Subject
Message content
Allows to attach files
Select Confirm.
In this example, the result would be a User Function that would permit sending an E-mail message to the
destination financial.director@cliente.pt. That function could then be executed in the PRIMAVERA ERP from
the user functions window, from a user menu or from a shortcut in the Navigator.
Pg 54
However, an XDU of this type would not have much practical utility because it would only allow sending an Email to a specific fixed destination (or several fixed destinations).
The PRIMAVERA Platform, in fact, allows this concept to be extended through the definition of parameters. In
this way, the same user function can be used to send payment warnings to any customer.
Parameters Definition
In the E-mail type user functions, the parameters must be declared by the user, in any of the definition fields,
using a specific syntax (@@NameOfParameter@@).
Returning to the previous example, let us suppose that you wanted the user function to allow:
Pg 55
Customer statement
As the user defines the parameters using the expected syntax, the application will carry out their recognition
and these will be presented on the "Parameters/Result" page:
Parameters defined by
user
Associated values
Pg 56
At this point you can define all the characteristics of each one of the User Function parameters (type of data, default
value, list of values, etc.). For more information, consult the section regarding "Parameters".
Result Definition:
"Email" type functions do not allow the defining the results of their execution.
External Application
To create a User Function that permits the execution of applications or documents external to the
PRIMAVERA solution, follow the following steps:
1.
Select the "User Functions" option from the "Tools" menu in the ERP;
2.
The following window presents all the available user functions in the system. Select "New...":
3.
In the following window you can define the properties of the user function. On the first page introduce
the name of the function, select the "External Application" type and introduce a more detailed description:
4. On the "Definition" page you must indicate the location of the external application:
Pg 57
Field
Command
Parameters
Initial Dir.
Execute (Window)
Description
Application Location
Parameters
Initial Directory
Initial windows status
5. Select "Confirm".
Parameters Definition:
Pg 58
Result Definition:
The execution of external applications allows defining how to process the result:
Pg 59
None: the execution result will not be processed by the execution engine;
Full: the executed application will produce an "exit code" which will be processed
by the engine at the end of the execution.
Macro VBA
To create a User Function for the execution of macros defined in the VBA project, follow the following steps:
1.
Select the "User Functions" option from the "Tools" menu in the ERP;
2.
The following window presents all the available user functions in the system.
Select "New...":
3.
In the following window you can define the properties of the user function.
On the first page introduce the name of the function, select the "Macro VBA"
type and introduce a more detailed description:
4.
Pg 60
6.
Select Confirm.
Atention
The definition of the macros must be carried out previously in the VBA project of the application or in the shared (among all
applications) project.
The list of macros will include all the macros (procedures without parameters or results), public procedures (with or without
parameters) and public functions (with or without parameters) defined in the VBA project of the application or in the common project
for the active company.
Definition of Parameters:
Pg 61
This Macro has as initial parameter in the VBA code the String type variable User.
Result Definition:
The result of the user function will also be determined by the definition of the macro. The returned value of this
Macro is a Boolean.
Query SQL
To create a User Function to execute SQL queries, follow the following steps:
1.
Select the "User Functions" option from the "Tools" menu in the ERP;
2.
The following window presents all the available user functions in the system.
Select "New...":
3.
In the following window you can define the properties of the user function.
On the first page introduce the name of the function, select the "SQL Query"
type and introduce a more detailed description:
4.
On the "Definition" page you must specify the SQL Query to be executed:
Pg 62
SQL instruction to be
executed
5.
Select Confirm.
Parameters Definition:
The User Function parameters can be defined according to the previously described syntax:
Pg 63
Pg 64
Text, Integer, Numeric, Date, Boolean: the query returns a recordset with only one
record with only one column, which must be interpreted according to the type of
data selected;
List of records: The query returns a recordset with various records and various
columns.
Parameters
The following information is associated to each user function parameter:
Size: defines (for types of data where this is significant) the size of the maximum
value;
Mandatory: defines if the parameter is necessary for the function to be carried out;
Value: defines the discrete value associated to each parameter at the moment of
carrying out the function.
Generically, in order for the user function to be carried out correctly, it is necessary for the value
corresponding to each mandatory parameter to be defined at the moment of execution. However, the
configuration module of User Functions allows defining the default value, the possible values or carrying out
the calculation of the value as a result of expressions.
Fixed Value
In this case, a discrete value will be attributed to the selected parameter which can, or does not have to, be
later modified by the user at the moment of execution of the function;
Pg 65
Default value
Possible values
Pg 66
Table
Pg 67
Finally, it is necessary to indicate the query field that must be used to determine the value of the parameter
and other options:
Field to be used to
determine the parameter's
value
Default value
Pg 68
Formula
In this case, the parameter value is determined by the result of the execution of a formula.
The value resulting from the expression will be determined immediately before the function is carried out; the
expression can include:
Aplicao
Utilizador
Perfil
Base de Dados
Data / Tempo
Pg 69
Genricas
Matemticas
Texto
Ateno
The expression/formula associated to the parameter value must observe the VBScript syntax.
The context fields are identified by the syntax @@FieldName@@.
Function
In this case, the parameter value will be determined by the result of the execution of another user function:
User functions with parameters defined in this manner trigger the execution of all dependent user functions
immediately before their own execution.
Execution
A user function can be executed (Execute button):
Pg 70
From Navigator;
With the exception of the last case referred to above, the execution of the user function will be carried out
immediately, interacting with the user to:
Request the values of all parameters (not completely defined in the configuration);
Example
To exemplify this behavior let us consider the definition of a user function with the following characteristics:
1.
The aim is to obtain a list of customers that have a sales volume in excess of
a certain value for a specific month;
2.
3.
Pg 71
Pg 72
Pg 73
Immediately before the execution of the function, all parameters would then be requested from the user in a
form similar to the following:
Fixed value
The result of the function - in this case, a list of records, is then presented to the user:
Sending SMS messages is carried out synchronically. In other words, whenever a user function of the "SMS" type is
carried out, the respective message will be placed in a waiting line to be sent. Actual sending will be carried out by the
"PRIMAVERA Process Management" application in accordance with its defined execution scheduling.
Pg 74
PKB
User Functions
Pg 75
User Menus
This tool allows extending the menus of any PRIMAVERA application, adding new commands associated to
user functions for carrying out certain actions when selected by the user.
The user can create a new submenu which will then appear immediately in the User Menus area of the ERP.
The user can configure other submenus and commands.
Pg 76
Each of the commands - the menu items that execute something when selected - will be associated to a user
function (responsible for the execution).
To create a Submenu
1.
Select "User Menus" from the "Tools" menu in the ERP; The user menus configuration form will be
opened:
2.
Seleccione o sub Select the submenu under which you intend to create the new submenu and select
"Submenu";
3.
In the following window introduce the title of the submenu and the associated "tooltip":
Pg 77
4.
You can change the title of the "Others" menu, by selecting the corresponding node in the previous window and choosing
"Properties".
After defining the user menus, it is necessary to access the Administrator to define the access permissions. Until then,
only system administrators will have access to the new menus.
You can reorganize the order of the items of each submenu by using the arrows provided in the previous window.
To create a Command
1.
Select the submenu under which you intend to create the new command and select "Command";
Pg 78
2.
In the following window introduce the title of the command, the associated tooltip and the user function
to be executed:
This list presents all the
available user functions in the
system
Pg 79
3.
The Properties button allows editing the selected item, the Remove button allows removing the selected
item.
PKB
User Menus
Pg 80
User Processes
User Processes (PDU) complement User Functions, allowing the scheduled execution of sequences of
actions (functions) in a server, without user intervention.
Using this mechanism, the user is provided with a tool for the automation of repetitive tasks, able to implement
specific business rules.
In order to illustrate this concept, the following can be considered as examples of programmable tasks in the
form of User Processes:
Automatic Orders: monitoring of all articles which are out of stock and consequent
creation of automatic orders;
Apart from complementing the User Function concept, a User Process extends the PRIMAVERA solution
because it provides an alternative implementation tool to the VBA. Although the VBA can be used to
implement very complex business processes, in most cases, User Processes facilitate this task:
Because the configuration environment does not require programming skills, and is
therefore more accessible to less experienced users;
Because they are carried out without the need for user intervention;
One or more steps (each of which corresponds to a User Function) carried out
sequentially;
The definition of the entry parameters and the results of each step (merged into
one another);
Pg 81
Ateno
The use of user functions in user processes is subject to the following limitations:
(1) VBA Macro - only functions of this type can be used provided they point to macros defined in the ERP project;
(2) User Maps - only functions of this type can be used provided they are configured to send by E-mail and/or export the map to a disc
directory.
Configuration Environment
The configuration environment of User Processes is available in the "Tools" menu.
By selecting this option in the main menu, the user will have access to the User Process definition window. It
will be possible to create new processes, execute, modify, duplicate or eliminate existing processes from this
form.
To create a new process just select the option "New...". The assisted configuration environment then appears.
Pg 82
Toolbar
Design Area
Execution State
Toolbar: contains a set of options to save, configure and execute the user process;
"Toolbox": contains all the necessary elements for creating new steps or conditions
in the process;
Design Area: visual area allowing the configuration of steps and the process
execution flow;
"End of Process": final state of process (marks the end of the execution).
The main component of the environment is the design area - all process configurations are carried out here.
You can create new steps or conditions by dragging the respective element to the white area. You can
change each element by using the "Properties" option in the context menu. And you can change the execution
flow, by linking each step and/or condition.
Pg 83
2.
You will have access to the properties form of the User Process:
Name and
description of
the process
Activate this
option to permit
the scheduled
execution of the
process
Automatic
notifications
during
execution
Definition of the
execution
calendar
Pg 84
Steps Definition
After defining the main properties of the process, the next step must be the definition of the steps that
compose the process. To illustrate this procedure let us consider the example of automatic orders once
again. The assumptions are the following:
The first procedure does not require any parameter and returns a numerical value
that corresponds to the necessary number of units to replace the stock of article
A1;
The second procedure accepts two parameters - the article code and the number
of units to be ordered - and produces an order from a supplier for that article.
To create a user process that automates this procedure, it is necessary to follow the following steps:
1.
Select the "User Processes" option from the "Tools" menu in the ERP;
2.
Select "New":
3.
Select the "Start of Process" node and choose "Properties" in the context menu;
4.
5.
Active a pgina Activate the "Scheduling" page, activate "Execute Periodically" and choose "Change":
Pg 85
7.
8.
9.
In the toolbox, select the "Stored Procedure" element and drag it to the design area (a new step will be
created and the properties window of that step will be automatically opened);
10.
This command
allows a new
user function to
be created
Pg 86
11.
12.
Pg 87
13.
Once again, select the recently created function in the step properties:
14.
The "Configuration" page indicates the parameters and the result of the step (from the definition of the
User Function). Choose "Confirm" (a new node will be created in the design area of the process
corresponding to the new step):
Pg 88
15.
Create a new step corresponding to the execution of the second stored procedure:
Pg 89
Pg 90
Pg 91
16.
Pg 92
Pg 93
17.
Next, define the execution flow, connecting the various nodes between themselves:
18.
Definition of Conditions
An essential tool to make the User Processes more adaptable to each situation is related with the definition of
conditions that change the execution flow according to specific criteria.
Consider the following example:
You want to implement a sales analysis process capable of carrying out the
processing of bonuses (if sales exceed the budget value) or sending notifications
(in the opposite case);
This process will execute the second step depending on the first (the sales
analysis).
Pg 94
This example illustrates the use of a condition to adapt the same process to two distinct situations.
The definition of the condition would be as follows:
Pg 95
Condition to be applied
to the result of the
previous step
Actions dependent on
the result of the
condition
The value of the parameter will be determined by its definition in the User
Function associated to the step.
Frmula
Funo
Resultado do passo
anterior
Valor fixo
The value must be defined by the user and will be fixed in any execution
process.
The result of the step is always determined by the definition of the associated user function.
Pg 96
The result of the step is always determined by the definition of the associated user function. The types of values
associated to the parameters will depend on the type of parameter data and the remaining steps already defined. For
example, if there is no step that returns a value of the "Integer" type, it will not be possible to define, for a parameter of
that type, a "Result of the previous step" value.
Execution Environment
User processes are usually carried out by the PRIMAVERA Process Management application, in a machine
configured as a server.
Its execution will be carried out according to the defined schedule, as soon as the server is available (for
example, after terminating the execution of another process or the sending of SMS messages).
For the purposes of testing, it is possible to execute a user process from the configuration environment
(described in the previous points).
Finally, a process can be explicitly carried out upon user request, from a shortcut configured in the Navigator.
In this case, its calendar will be ignored and the process carried out immediately.
PKB
User Processes
Pg 97
User Alerts
The User Warnings are the new way of defining warnings, much more parameterisable, providing the user
with much more detailed control over a set of critical information about which it is indispensable to obtain
periodic warnings.
The periodicity of the warnings is itself also definable at the moment of its configuration, thus adapting it to the
needs of each user profile.
To illustrate this feature, let us consider some examples of information adaptable to a User Alert:
For each piece of information indicated above it is possible to create a User Alert.
The configuration and User Alert visualization environment is available in the "Tools" menu.
By selecting this option, the user will have access to the User Alerts presentation window.
Pg 98
It will be possible to create new warnings, execute, modify, duplicate or eliminate existing warnings from this
form.
To create a new process just select the option "New". An assistant then appears that will help you create a
new Warning.
Warning Definition
To better explain the various steps needed to create a User Warning, we shall use an example.
Example
We shall create a warning that allows users to obtain periodic information on the anniversaries of company
employees.
Pg 99
Optionally, you can create a new list to subsequently associate to the warning by selecting the option "New".
In this case, the option "Filter" is selected to define the category of the correct list. The intended list is
obtained through a Stored Procedure previously created in the Exercise. All existing Stored Procedures are
presented in the <Queries SQL> category.
Pg 100
Optionally, you can choose to proceed with the default configuration by passing directly to the definition of
users with access to the warning. In this example, you deactivate the option to be able to carry out a more
detailed configuration.
Pg 101
The way the results are to be presented is defined. The results of the last warning execution are presented or
a warning with alert is marked when There are results/There are no results.
It is indicated whether the results must be sent as notification and if they must be published. For both options,
their behaviour must be defined.
Pg 102
Optionally, define if the warning is independent from the user that executes it. Define if it can or can not be
executed manually and after how long the warning becomes out of date. It is also possible to schedule the
warning execution.
Pg 103
It is possible to
schedule the
warning execution
automatically to
be carried out by
the Windows
Scheduler.
Indicate the name, description, priority and the respective category of the User Warning.
Optionally, activate the warning created and/or add it to the Business Monitor.
Pg 104
Pg 105
Execution Environment
In spite of being a warning with a scheduled execution it is possible to immediately execute (processing) its
associated information, being immediately sent by E-mail to the respective recipients.
For this you just have to use the "Execute" option from the toolbar or the context menu.
Pg 106
We can as mentioned previously, during the creation of the Warning, or later by editing a created warning,
carry out the scheduling of its execution.
Pg 107
Results
The next time any of the recipient users of the Warning enters the ERP, they will be presented with the
Business Monitor that will contain, among other information, a specific location for the viewing of their
warnings.
The Business Monitor is accessible by the "Business Monitor" option from the "User" menu in the ERP.
PKB
User Alerts
Pg 108
User Indicators
The User Indicators are a feature that allows each user to observe, in a quick and easily perceptible way, a
set of pertinent information.
The User Indicators configuration and visualization environment is available in the "Tools" menu.
By selecting this option, the user will have access to the presentation window of the existing User Indicators.
To illustrate this feature, let us consider some examples of information that can be visualised in the form of a
User Indicator for two distinct areas of the ERP:
Human Resources Area
Seniority;
Qualifications;
Absenteeism Rates;
Resignations
Sales Area
Pg 109
For each piece of information indicated above it is possible to create a User Indicator.
From the User Indicators configuration form it is possible to create new indicators, execute, modify, duplicate
or eliminate existing indicators.
To create a new indicator just select the option "New". An assistant then appears that will help the user
configure a new indicator.
Indicator Definition
To better explain the various steps needed to create a User Indicator, we shall use an example.
Example
We are going to create an indicator that allows users to obtain information about the Articles that are in the
Top 10, for the current month. Obviously, this indicator will probably present different information throughout
the month since the analysis will be carried out whenever the respective indicator is executed. If we choose a
daily execution, we will obtain an updated daily image in relation to the intended information.
Pg 110
Pg 111
Optionally, proceed with the default option if you want to use the most common options to define a simple
indicator. Here you do not intend to proceed with the default configuration. In this way, the option is
deactivated.
Indicate the actions to be carried out automatically, by the system, after executing the indicator:
- Send result notifications using: enables sending results, via SMS/E-mail, to users who have the
indicator in the Business Monitor;
- Publish results to: enables publishing the results in a file or FTP site.
Both options must be duly configured by accessing and filling in the "Options" data.
Pg 112
Pg 113
Schedule the execution of the indicator to occur every day at 00:00 AM. In this way, the indicator's graphic
result obtains its data from the information of sales closed the previous day.
Indicate the indicator's general data: name, description, presentation of results (Graph or List of Records) and
category.
Pg 114
Finally, one must choose the type of graph that will support the presentation of the Indicator's graphic results.
Pg 115
The Indicator will be provided in the list of User Indicators, where it can eventually be carried out.
Consequently, it can include the Indicator for monitoring the Business Monitor service.
PKB
User Indicators
Pg 116
Navigator
The Navigator offers users the possibility of configuring the work environment in each module, adapting it to
their needs. By using this feature, users can:
Configure their own views of the most important data of the ERP;
From the perspective of the system administrator, responsible for the configuration of the PRIMAVERA
solution, the Navigator supplies the necessary tools to adapt it to each profile of users:
Guaranteeing that each user has access to all the relevant information for their
work, in the correct format;
Providing all the extensibility tools in a way that is totally integrated with the
application.
As a productivity tool, the Navigator is, generically, a shortcut and list configuration. It is integrated in each
application, as demonstrated by the following image:
Show/Hide Browser
Context button.
Pg 117
PKB
Browser
Pg 118
Shortcuts
The user may create the following types of shortcuts:
Lists;
External applications;
Documents;
Web Pages;
Application menus;
User Functions;
User Processes;
Companies.
All shortcuts can be organized and grouped into folders, in a similar structure to that available in Windows to
organize files.
2.
3.
In the following window, select the external application and define the remaining shortcut properties:
Pg 119
4.
Pg 120
2.
In the following window, introduce the address of the page or select one of the available pages in
Internet Explorer favorites:
Pg 121
2.
In the following window, select the application menus for which you want to create shortcuts in the
Navigator (can be created several shortcuts at the same time):
2.
Pg 122
2.
2.
Pg 123
Creating shortcuts to companies provides a mechanism for quickly opening a specific company. This tool is particularly
useful in installations with many companies, such as for example, accounting offices.
PKB
Navigator
Lists
Information Categories
The creation of lists allows:
Access to all the data of a specific entity, in addition to the concept of tables;
The configuration of filters, conditions and sorting of the data of each entity;
In this way, all the data of each Module/Area are organized into Categories that group all the relevant tables to
obtain the relevant information on a specific entity.
In practice, this means that the Customers category provides all the data related with customers. In addition to
the associated table, it will include data on salespeople, sales, contacts, currencies, etc.
The Navigator thus becomes the main source of data for the user and an indispensable tool to configure the
solution and adapt it to each specific situation.
The available categories will depend on each of the applications. As an example, below are presented some
of the categories of the Logistics & Treasury area:
SOME OF THE
LOGISTICS
AND
TREASURY
CATEGORIES
Warehouses;
Banks;
Bank Accounts;
Purchase Documents;
Stock Documents;
Sales Documents;
Expedition Modes;
Bank Movements;
Purchase Movements;
Pg 124
Creation of Lists
To create a new list, follow the following steps:
1.
2.
In the following window, select the category for which you want to create a new list and select "New...":
Information categories
of the active
application.
Pg 125
3.
4.
The first step allows you to select the list columns from each table that compose the information
category:
Pg 126
5.
In the following step, you can define conditional sentences to filter the data on the list according to
specific criteria.
6.
Next, you can define totalizers over the previously selected numerical columns:
Pg 127
7.
8.
In the next step, you can define the conditional formatting to apply to the list records:
Pg 128
9.
Pg 129
In this step, you can also define the following advanced options of the list:
Maximum number of
records
Allows limiting the maximum number of records presented in the list result.
This option can be useful in lists with many records and in which, in
principle, it is possible to predict that the searched record is among the first
records.
Eliminate duplicate
records
Allow eliminating all the repeated records in the list by presenting only one.
Pg 130
10.
By selecting the preview option, you will be presented with the result in the next step:
11.
Finally, you must indicate the name of the new list and the respective availability for the remaining
users:
Pg 131
Pg 132
After the assistant has concluded, the new list is available to be added in the Navigator:
To add the new list to the Navigator, choose it from the list and select "Confirm":
Sorting of Records
You can define up to five sorting criteria for the records on the list.
Sorting records
Pg 133
To define the sorting criteria, you must indicate each sorting field and the respective rank:
Sorting Columns
The rank of the list columns can be defined in the list creation form:
Pg 134
Aliases
In certain situations, namely, in lists resulting from the aggregation of various tables, it may be necessary to
rename some columns:
12.
Pg 135
A form will be presented that allows you to define the calculated expression:
Available columns in
the list.
Operators
Expression
Name of
theexpression.
Alias
Pg 136
Conditions
A conditional expression allows the definition of a condition which will filter list results according to a certain
criterion.
This is one of the lists most important features, because it allows the user to define lists configured exactly in
accordance to the users information needs, facilitating:
General performance of the application given that, by filtering the data, the quantity
of information accessed at any moment is reduced, accelerating its processing;
2.
Select the column which you want to apply the condition to:
Pg 137
Conditional operator
(the available
operators depend on
the type of data of
the selected column).
3.
To create a subexpression:
The various conditions defined can be combined in subexpressions to which the AND or OR logical operators
will be applied.
To create a new subexpression, follow the following steps:
1.
2.
3.
Pg 138
Pg 139
Or create a list of values resulting from the execution of a query in the database:
Pg 140
This configuration results in a parameterized list. Whenever the user starts editing, all parameterized values
will be requested. This enables the user to, for example, define generic lists adapted to the users needs at
any moment.
Pg 141
Aggregate Totals
You can define totalizers over any one of the numerical fields defined in the list. The following operations are
available:
Counter;
Sum;
Average;
Minimum;
Maximum;
Standard Deviation;
Value Counter.
Pg 142
The way of parameterising the obtainment of results is identical to the options previously explained in the
"Conditions" section.
Grouping
You can define automatic groupings over the records resulting from the list:
Pg 143
Pg 144
Conditional formatting
Conditional formatting enables highlighting the records in the list which obey a certain condition.
To create a new conditional formatting:
1.
2.
Select the column which you want to apply the formatting to;
3.
4.
Select the letter and background colors to apply to the records that fulfill the criterion:
Pg 145
Pg 146
List Query
All the lists configured by the user can be accessed/consulted from:
Pg 147
F4
Operations on a List
More than a tool to consult data, lists provide the user with a set of features enabling the manipulation of data
so as to obtain additional information, carry out its publication and use it to support a wide variety of
management functions.
The operations on lists and their data are available in the toolbar and in the context menu:
Category Lists;
Editing Records;
Quick Filters;
Quick Searches;
Searches;
Drilldown;
Sorting of Records;
List printout;
Printout of Maps;
Exporting of Records;
Pg 148
In the system preferences (available in the application) for each user, provided they
have permission for this.
The first option is particularly useful from the perspective of the user responsible for the initial configuration of
the system.
Pg 149
The second option must be used by users with more advanced permissions and/or with additional needs for
flexibility in the use of the application.
PKB
Lists
Pg 150
Categories
It is possible to condition results through the application of conditions during the list creation process or in the
editing of its properties. A conditional expression consists in the definition of a restriction which filters list
results through a criterion. This is one of the most important features regarding lists, since it allows the user to
define lists configured exactly in accordance with the user's information.
However, there may be situations /decisions when this procedure is applied transversally, that is, for the
actual category information. This scenario consists essentially in one or more conditional expressions
transversal to all the lists associated to a category. In summary, the lists always have a conditional expression
specified in the category.
PKB
Pg 151
User Maps
PRIMAVERA products allow the user to configure any map or list according to their tastes. The possibilities
provided by the report generating tool, Crystal Reports, by the acknowledged world producer Business
Objects - of which PRIMAVERA Business Software Solutions is the exclusive Portuguese representative - are
immense.
All the maps or lists generated from the PRIMAVERA software use Crystal Reports. The programmes provide,
at each option, a configuration, which was typified as <SIST>, that is, the system configuration, the
configuration according to PRIMAVERA Business Software Solutions. That report must not be changed by the
user who, for this effect, must duplicate it by giving it another name and carry out the necessary changes on
the duplicate. In this way, it is guaranteed that the user will not damage, by accident, the base maps that
were delivered with the programmes.
To duplicate a Map
1.
In the Map Maintenance window select the map that you want to duplicate;
2.
3.
Give a name to the new map and confirm. Upon exiting the option, the new map appears in the Map
Maintenance window.
Pg 152
2.
3.
Access Crystal Reports through the "Editing" option. If the programme is not installed on your system,
the application will warn you of that fact;
4.
After changing the map, save the changes in Crystal Reports and exit the programme. From this
moment on, you can use your map whenever you want.
The manual accompanying the product presents an explanation for handling Crystal Reports, in digital format or through
the help programme. Crystal Reports is a product developed in English and the level of difficulty regarding its use varies
from extremely simple to extremely complex, depending on the users' intentions.
PKB
User Maps
Pg 153
Pg 154