cancel
Showing results for 
Search instead for 
Did you mean: 

Form -- Invalid Form use Navigate Menu

Former Member
0 Kudos

Dear All,

    I am using SAP Business one studio . I am getting "Form Invalid Form" Issue when Click MoveFirstRecord(1290). On first time , it works, from second time on wards i am getting this error.

I set flag variable for Open and Close

Code in item event.

beforeaction = true

  Case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE

                                    flag = 1

On the second time , First Form Load event Trigger

beforeaction = False

Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD

                                    oForm = SBO_Application.Forms.Item(FormUID)

                                    oItem = oApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)

Case SAPbouiCOM.BoEventTypes.et_FORM_VISIBLE

                                    If flag = 0 Then

                                          add DocEntry

                                          Enable some Menus(like Navigator Menu)

                                     END If

In Menu Event

menu Id 1290

If flag = 0 Then

                           

                            oForm.Freeze(True)

                            If Not String.IsNullOrEmpty(EditText0.String) Then

                                oForm.EnableMenu(AddDocument, True)  '' To Enable Add Document Menu When user click Navigation Menu

                                Matrix0 = oForm.Items.Item("OMatrix").Specific

                                FillData(Matrix0)

                                oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE

                                ChangeButtonCaption()

                            End If

                            oForm.Freeze(False)

                        ElseIf flag = 1 Then

                             oForm.Freeze(True)

                       

                            If Not String.IsNullOrEmpty(EditText0.String) Then   '' Getting Error

                            oForm.EnableMenu(AddDocument, True)  '' To Enable Add Document Menu When user click Navigation Menu

                            Matrix0 = oForm.Items.Item("OMatrix").Specific

                            FillData(Matrix0)

                            oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE

                            ChangeButtonCaption()

                            'End If

                            oForm.Freeze(False)

                        End If

                    Catch ex As Exception

                        Message(ex.Message, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

                    End Try

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

where is your oForm declaration variable? where do you set the oForm variable?

Former Member
0 Kudos

Hi,

  Thanks for your reply.

Declare in above constructor .

I set oForm in the Form Loading Event.

Former Member
0 Kudos

Try yo get some form info before the error, such as title, uid, typeex

Former Member
0 Kudos

Thanks . I will check