SAP B1 Error - Form - Not found [66000-9]

191 views Asked by At
case "2305":
{
     SAPbouiCOM.Form oForm = Support.oApplication.Forms.GetForm("142", 1);

     FrmPedidoCompra frmPedidoCompra = new FrmPedidoCompra(oForm);
                        
     frmPedidoCompra.CreateButtonNovaDataEntrega();
     break;
}

I have this code and i want to know why it returns the message: Form - Not found [66000-9]. 142 is the type of Purchase Order, isn't it?

I tried everything. Trade 142 by 139 for example, but the error continues.

1

There are 1 answers

0
DEPARTED On

Is this form already opened? Because this method does not open new one it just returns exsisting one if there is any.

From documentation:

Each SAP Business One form has a type, which is a unique ID for the form. For example, the type of the Purchase Order form is 142.

Each form can be open multiple times, and the application keeps a counter for each form type of the number of open instances. To get the number of forms open of the same type, use Form.TypeCount. Form objects pointing to different instances of the same type form have the same value in the TypeCount field.

To access a specific instance of a specific form type, use the Forms.GetForm method.