-1
I intend to initialize two context variables being ErpBS BSO
and StdBSInterfPub PSO
when I add an extension to Spring.
Why? I would like to use these variables with static classes and/or with Forms (which are not the ones from the Spring API). Could define the context or have a "general context"?
How can I detect when an extension is placed in spring?
Right now the only way I know how to do this is to use the function DepoisDeAbrirEmpresa
or assign context through classes that themselves make use of their specific context (For example ClassName : FichaArtigos
).
using Primavera.Extensibility.BusinessEntities.ExtensibilityService.EventArgs;
using Primavera.Extensibility.Base.Editors;
namespace Projeto
{
class ClassName : FichaArtigos
{
public override void AntesDeEditar(string Artigo, ref bool Cancel, ExtensibilityEventArgs e)
{
base.AntesDeEditar(Artigo, ref Cancel, e);
AMinhaClassStatic.PSO = PSO;
AMinhaClassStatic.BSO = BSO;
}
}
}
I would like to be able to initialize the variables assuming that the company is already open.
EDITED 19-12-2019
Example of AMinhaClassStatic
, requested in comments. This example shows how it is not possible to use variables without first initializing.
using ErpBS100;
using StdPlatBS100;
namespace Projeto
{
class AMinhaClassStatic
{
public static ErpBS BSO;
public static StdBSInterfPub PSO;
public static void teste()
{
PSO.Dialogos.MostraAviso("teste");
BSO.Base.Clientes.AlteraCodigoCliente("TSTE", "TESTE");
}
}
}
public static ErpBS BSO = new ErpBS();
Doesn’t seem to help.
public static StdBSInterfPub PSO = new StdBSInterfPub();
Takes arguments I don’t know what they are.
tl;dr I intend to initialize BSO
which is a spring context variable of the type ErpBS
and initialize PSO
which is a variable referring to the platform of type StdBSInterfPub
, it would be possible to initialize one with context and another with the platform environment?
I have no idea how spring influences the problem, but I was surprised that
AMinhaClassStatic
,PSO
orBSO
are defined in your code. What are these objects?– Woss
@Woss The problem is wanting to use API variables but not being able to use them without first initializing them. I am aware that what I intend to do is not the right way to do this but having this knowledge would be helpful. Look at Edit.
– hp-psi