I can not get the development SDK100 running

3

Although I know that there is a bug in this component, I have this indication of PRIMAVERA, I'm moving forward with its use even though I have to fill some properties manually while the bug is not corrected so if the errors I'm reporting are related with the bug, then they are all answered. First, the component initialization ( f41.Inicializa(contexto) ) takes about 19 seconds. And yet ? It is easy to have 4, 5 or more components of these in a form and if this time each takes, it will not be possible to use them. With the code below to initialize the component, pressing F4 says that the profile does not have permissions to access the information category. (the user concerned is super administrator and within the ERP has access) Finally, what are the specific properties and methods that are commented on?

PRISDK100.clsSDKContexto contexto = new PRISDK100.clsSDKContexto();
contexto.Inicializa(MotorPrimavera.Motor, "GCP");
contexto.InicializaPlataforma(MotorPrimavera.Plataforma);
f41.Modulo = "GCP";
f41.Categoria = PRISDK100.clsSDKTypes.EnumCategoria.Clientes;
f41.IDCategoria = "Cliente";
//f41.CampoChave = "";
//f41.CampoChaveFisica = "";
//f41.CarregarValoresEdicao = false;
//f41.ChaveFisica = "";
//f41.ChaveNumerica = false;
//f41.PermiteDrillDown = true;
//f41.PermiteEnabledLink = false;
//f41.FormataLabel();
//f41.Limpa();
//f41.Termina();
f41.Inicializa(contexto);
    
asked by anonymous 09.08.2018 / 16:44

1 answer

5

You can not delay this time, this is used in ERP everywhere. As for the documentation it will be on the developers network.

You do not have permissions because the category is wrong, it's Clients and not Clients.

An example implementation type.

using System;
using Primavera.Extensibility.CustomForm;

namespace FormacaoLisboa
{
    public partial class Form1 : CustomForm
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            f41.Categoria = PRISDK100.clsSDKTypes.EnumCategoria.Clientes;
            // Ligação com a categoria
            f41.IDCategoria = "Clientes";
            f41.Audit = "mnuTabClientes";
            f41.CampoChave = "Cliente";
            f41.CampoDescricao = "Nome";
            f41.Modulo = "BAS";

            // Comportamento. São opcionais.
            f41.CarregarValoresEdicao = false;
            f41.ChaveNumerica = false;
            f41.PermiteDrillDown = true;
            f41.PermiteEnabledLink = false;

            // Só é chamado uma vêz.
            SdkPrimavera.InicializaContexto(BSO, PSO);

            f41.Inicializa(SdkPrimavera.ContextoSDK);
        }
    }

    internal class SdkPrimavera
    {
        private static readonly SdkPrimavera contexto = new SdkPrimavera();
        private static PRISDK100.clsSDKContexto contextosdk;

        public static PRISDK100.clsSDKContexto ContextoSDK
        {
            get
            {
                return contextosdk;
            }
        }

        private SdkPrimavera()
        {
        }

        public static SdkPrimavera InicializaContexto(dynamic BSO, dynamic PSO)
        {
            contextosdk = new PRISDK100.clsSDKContexto();
            contextosdk.Inicializa(BSO, "ERP");
            PSO.InicializaPlataforma(contextosdk);

            return contexto;
        }
    }
}
    
09.08.2018 / 18:17