V10 ResourcesGuides
ResourcesGuides
Guides
Back | List of Articles

How to create an integration project with Visual Studio?

Last changed in 02/12/2020

This document describes the necessary steps to create an application that integrates with the PRIMAVERA ERP.

Requirements

  • PRIMAVERA ERP 10
  • .NET Framework 4.7

Step 1 - Base references

1. To access the entity services exposed by the different modules, add a reference to the ErpBSxxx.DLL assembly.

2. To access the services exposed by the platform, add a reference to the StdBSxxx.DLL assembly.

3. To access enumerated items, collections, etc. add a reference to the StdBExxx.DLL assembly.

Step 2 - Module references

1. To access the system's base entities and services (customers, items, unit, etc.), add a reference to the BasBExxx.DLL assembly.

2. To access, for example, the entities and services exposed by the sales module, you must add references to the VndBExxx.DLL and IVndBSxxx.DLL assemblies.

Step 3 - Opening the company

1. Opening the company is the first step to take before using API. This method is used to authenticate the user and validate company access permissions (database), thus ensuring access to the services exposed by the modules.

Step 4 - Opening the platform

1. This step is only necessary if you need to access technological services, such as the using the lists, reporting, security, dialogs, etc.

2. Below please find the complete initialization flow of the ERP API:

public static PriEngine CreatContext(string Company, string User, string Password)
{
  StdBSConfApl objAplConf = new StdBSConfApl();
  StdPlatBS Plataforma = new StdPlatBS();
  ErpBS MotorLE = new ErpBS();

  EnumTipoPlataforma objTipoPlataforma;
  objTipoPlataforma = EnumTipoPlataforma.tpEmpresarial;

  objAplConf.Instancia = 'Default';
  objAplConf.AbvtApl = 'ERP';
  objAplConf.PwdUtilizador = Password;
  objAplConf.Utilizador = User;
  objAplConf.LicVersaoMinima = '10.00';

  StdBETransaccao objStdTransac = new StdBETransaccao();

  try
  {
    Plataforma.AbrePlataformaEmpresa(Company, objStdTransac, objAplConf, objTipoPlataforma);
  }
  catch (Exception ex)
  {
    throw (ex);
  }

  if (Plataforma.Inicializada)
  {
    MotorLE.AbreEmpresaTrabalho(objTipoPlataforma, Company, User, Password, objStdTransac, 'Default');

    Platform = Plataforma;
    Engine = MotorLE;

    EngineStatus = true;
  }

  return engineInstance;
}

See the code examples available on GitHub that will give you support in your integrations.

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?