V10 ResourcesGuides
ResourcesGuides
Guides
Back | List of Articles

How to create user tabs with Visual Studio?

Last changed in 29/10/2021

This document describes the steps required to create your first project of user tabs for the PRIMAVERA ERP.

Requirements

  • PRIMAVERA ERP
  • Visual Studio & NET Framework 4.7

Step 1 - Create the project

1 - After opening Visual Studio, select File > New > Project.

2 - From the tree on the left of the displayed window select your development language (C# or VB).

3 - Select the Class Library (.NET Framework) project type.

4 - Assign a name to the 'Primavera.Base.CustomTabs' project and press OK.

5 - Add a User Control to the project.

At the end of this step your project should look similar to this:

 width=

Step 2 - References

1 - After creating the project, you need to add a set of references to the extensibility platform, as well as to the modules that will work

  • Primavera.Extensibility.Base
  • Primavera.Extensibility.CustomTab
  • BasBE100: Access to the system's base entities (Customers, Items, Currencies, etc.).
  • StdPlatBS100 and ErpBS100. Access to the public platform API and the business API.

Note: All assemblies are located in the 'C:Program Files (x86)PRIMAVERASX100Apl' folder.

Step 3 - Link the control to an entity

1 - Rename the control from UserControl1.cs to CustomerFields.cs

2 - At the beginning of the class, add the following namespaces using the using policy.

3 - After the control name add CustomTab. This step indicates that our class will inherit from CustomTab and implement the customer file, which means it will be associated with the customers table.

 width=

Step 4 - Events

1 - After creating the inheritance to CustomTab, the control will automatically provide access to the four standard events ('Inicializa', 'Carrega', 'Grava' and 'Anula' - Initialize, Load, Save and Cancel). To subscribe to any of these events select the control, press F4 to call the properties window and then select the option to group properties followed by the events option.

 width=

Step 5 - Tab name

1 - To assign a name to the tab select the control, press F4 and in the properties window select the TabCaption attribute.

 width=

Step 6 - Add user fields

1 - There are two ways to edit and save the contents of user fields. One is automatic, i.e. without the need to write specific code, and the other is using code writing, both for editing and saving.

2 - To load user fields automatically follow these steps:

  • In the Administrator, create a user field 'CDU_FieldAuto' of type text in the client entity.
  • In Visual Studio select TOOLS > Choose Toolbox Items.
  • In the window select the .NET Framework Components tab.
  • Press Browse, navigate to the PRIMAVERA folder and find the 'Primavera.Platform.Extensibility.Controls.DLL' assembly.

 width=3 - Select and drag the 'PriTextEdit' control into the form.

4 - Select the Name property and enter the exact name of the previously created User field

5 - Compile and record the application in the ERP PRIMAVERA.

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!
Artigos Relacionados
Começar a Usar Como criar um projeto de integração com Visual Studio? Como criar um projeto de extensibilidade de interface (PEX) com Visual Studio? Como criar um projeto de extensibilidade de API (Motor) com Visual Studio? Como criar separadores do utilizador com Visual Studio?