How to create user roles with Visual Studio?
This document describes the steps necessary to create your first user role with Visual Studio. As the name implies, User functions (macro type) are pieces of code developed for the purpose of performing a specific operation. 1 - After opening Visual Studio, select File > New > Project. 2 - From the tree on the left of the displayed window select the 'C#' development language. 3 - Select the Class Library (.NET Framework) project type. 4 - Assign a name to the 'Primavera.UserFunction' project, and press OK. 1 - After creating the project it is necessary to add a reference to the extensibility platform as well as to the modules that you want to work with. 1 - Rename the class from Class1.cs to PrimeiraFuncao.cs 2 - Add the namespaces at the beginning of the class, using the using directive, as shown below. 3 - Next to the class name add CustomCode. This step indicates that our class will inherit all methods, properties and attributes from the CustomCode API base class, such as the PSO (platform access) and the BSO (module access). 4 - Create a public method with the Funcao1 name. Inside the created method, add the code as shown in the following image. All methods declared with the word public will be exposed in the ERP, which means that we can put the functions we need in classes. 5 - Compile your solution in BUILD > Build Solution. 6 - Register the assembly as described in "How to Register Extensibility Projects?" 7 - Register the user function as described in "How to Register a Macro User Function?"Requirements
Step 1 - Create the project
Step 2 - References
Step 3 - Create the function
login para deixar a sua opinião.