cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a form with detail information

Former Member
0 Kudos

Hi all,

i have create a matrix contain all Draft is Open and i make double click event on row to view detail form.

If omatrix.IsRowSelected(i) = True Then
                            Dim Docnum As Integer = omatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific.value
                            Dim Doctype As String = omatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific.value
                            Select Case Doctype
                                Case "Sale Order"
                                    'open Sales order Form on Docnum with detail information
                                Case "Delivery"
                                    'open Delivery Form on Docnum with detail information
                            End Select
                        End If

+ please show me how to open exactly form which i want to open

+ how to format an column in matrix is currency.

+ how to make total in the end of column.

Sympathize for my English.

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Peter,

Try This.....


Case "Sale Order"
 sbo_application.ActivateMenuItem("2050") 'opening sales order form
            oform = sbo_application.Forms.GetFormByTypeAndCount("139", 1)
            oform.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE
            Dim oedit As SAPbouiCOM.EditText
            Dim omatrix As SAPbouiCOM.Matrix
            oedit = oform.Items.Item("8").Specific
            oedit.Value = Docnum
            sbo_application.Forms.ActiveForm.DefButton = "1"
            sbo_application.SendKeys("{ENTER}")
            Dim finaltot As Integer = 0
            Dim i As Integer
            omatrix = oform.Items.Item("38").Specific
            Dim oedittot As SAPbouiCOM.EditText
'Doing Sum of Total Column
'to make total  of column.
            For i = 1 To omatrix.RowCount
                oedittot = omatrix.Columns.Item("21").Cells.Item(i).Specific
                finaltot = finaltot + oedittot.Value
            Next
            sbo_application.MessageBox("Total :" & finaltot)
        End If

Thanks

Shafi

Edited by: shafi_sunshine on Sep 2, 2011 8:22 AM

Former Member
0 Kudos

Hi All ,

Thanks for your all answer, its was very helpful for me, i can open sales order form with Docnum, But shafi i have 1 more question, how about if that document is Draft ? exeample a Sales Order Draft, it not contain in ORDR table. how i can open the

form Sales Order Draft with Draft DocEntry from table ODRF ?

Thanks

Peter

Former Member
0 Kudos

Hi,

Try ObjType instead of DocType. DocType only defines Item or Service type.

ObjType = '17' Sales Order and ObjType = '15' Delivery

Thanks,

Gordon

Former Member
0 Kudos

i need some help here....

former_member689126
Active Contributor
0 Kudos

Hi

If you are using SAP Business One PL 19 or above you can try the following for opening a form

Dim formType As SAPbouiCOM.BoFormObjectEnum
            'default: fo_None
            Dim strUDOObjectType As String
            Dim strObjectKey As String

            'For UDO objects, set the system form enum to be "fo_UserDefinedObject" at first.
            formType = BoFormObjectEnum.fo_UserDefinedObject
            strUDOObjectType = "myUDO"
            'UDO type
            strObjectKey = "udoKey"
            'Code
            Dim oForm As SAPbouiCOM.Form = oApp.OpenForm(formType, strUDOObjectType, strObjectKey)


            'For system objects. set system form enum for "BusinessPartners" at first.
            formType = BoFormObjectEnum.fo_BusinessPartner
            strUDOObjectType = "testUDO"
            'Will be ignored in this case.
            strObjectKey = "C00001"
            'primary key of "BusinessPartners" object.
            oForm = oApp.OpenForm(formType, strUDOObjectType, strObjectKey)

      
            If oForm Is Nothing Then
                'No form opened with the input parameters, add your own logics here...
      
            Else
                'Form opened successfully, do your own work here...
            End If

Summary Column is available in 8.81 only

Hope this helps

Regards

Arun