How to create a CustomCode which in turn calls a CustomForm?

4

How to create a CustomCode that calls CustomForm in V10. Is there any other way to "hang" the form in ERP?

public partial class FrmTeste : CustomForm  
{
    public FrmTeste()
    {

        InitializeComponent();
    }

}

public class FuncaoUtilizadorFrmTeste : CustomCode
{
    FrmTeste ttt = new FrmTeste();
  //O que colocar aqui para mostrar o formulario ?

}
    
asked by anonymous 28.05.2018 / 00:10

2 answers

2

In the configuration area, within the extensibility area choose Roles > New Role . In the combo box choose the function type User Form . Finally select in the TAB Settings and choose the form.

    
28.05.2018 / 15:51
2

Well, CustomForm and CustomCode are different things. CustomCode is typically used to evoke internal functions that execute a piece of code and which in turn can call an inner functions that show a form. In this case it is to do as below.

public class FuncaoUtilizadorFrmTeste : CustomCode  
{
    FrmTeste ttt = new FrmTeste();
    ttt.ShowDialog();
}

CustomForm is used to call a user form directly, that is, any form that inherits from CustomForm instead of Form . These forms appear inside the shell.

Conclusion, you are not to use the two mixed concepts, CustomForm should be used directly in the form:

public partial class FrmTeste : CustomForm  
{
    public FrmTeste()
    {

        InitializeComponent();
    }

}

CustomCode should be used directly in classes.

{
    public class CustomCodeSample: CustomCode
    {
        public void ShowMyForm()
        {
            FrmTeste entityCreator = new frmEntityCreator();
            entityCreator.ShowDialog();
        }
    }
}

Example in Git link

    
28.05.2018 / 11:13