Et_GOT_FOCUS BeforeAction

Has anybody got an idea why I can not catch the et_GOT_FOCUS event on the BeforeAction = True condition only on BeforeAction = False using Service Pack-00 and Patch Level-11

Hi Louis,
GOT_FOCUS and LOST_FOCUS are only fired on the BeforeAction=False.
Did you acceded them in another version?
Regards
Trinidad.

Similar Messages

  • Event firing multiple times (et_Got_Focus)

    Hi,
    I just noticed while debugging my Add On code that the et_Got_Focus event which I have added to my event filters is triggered 64 times when I change a field value and then move to a different field.  This not only happens in the matrix when changing field values and tabbing through but also in the header fields.
    This has got to be a bug and it is not only slowing down the A/P Invoice form but it is potentially very dangerous to have an event firing 64 times when it should only be fired once. 
    To test this all one needs to do is add the et_Got_Focus event to the event filter with the A/P Invoice form, then add a debug statement to write out the itemvalue properties and you will see once you edit a value and tab you will get 64 statements that are the et_Got_Focus event, BeforeAction false for the same field or column when it should only occur once.
    I have a very digrunted client that is very frustrated due to the amount this slows down data entry in the A/P Invoice.  I cannot get rid of this event because there is a particular field I am monitoring for the got focus event so I can stop it under certain circumstances.
    If anyone else has experienced this or knows how to resolve this please let me know.  I guess if I don't find out why this is happening I will post a CSN to SAP.
    Thanks very much,
    David Wall
    Here is a sample of my debug output messages for one update of a single field and then tabbing out:
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False
    et_GOT_FOCUS -  - False

    Hi David,
    We at Self Informatique France have the same problem of getfocus firing many times at one of our customers in Algeria although wae are not using formated search.Any solution ?
    Best Rgds.
    Antoine Egeileh
    President
    Self Informatique
    [email protected]

  • Issue with the pVal.BeforeAction in Item_Pressed event

    Hi all,
    I am facing an issue with the <b>pVal.BeforeAction</b> in the <b>Item Pressed event</b>.
    In delivery notes, When I press the Add button, i am getting the control, which is passing through both of the if blocks [<b>if (pval.BeforeAction=True)</b>block and <b> if(pVal.BeforeAction=False)</b>].
    But
    When I try the delivery using <b>Pick and Pack Manager</b> form with in the Inventory Menu, I am getting the same Delivery form in Add Mode. When I click the Add button in the form, the control  is passing through the <b>if(pCal.BeforeAction=true)</b> block successfully, but after that, the form closes and it never comes to the <b>if(pVal.BeforeAction=false)</b> block.
    I need to run the codes, what i have written in the second if block, in this case also.
    Is it possible?
    Please help me to solve this issues.

    Hi,
    It's a known bug. As Rasmus said try the SBO2005A SP01 FormDataAdd Event.
    Regards,
    Ian

  • Item Event - BeforeAction - true or false?

    Hi,
    Is there a basic rule for BeforeAction?
    I know you can play with BeforeAction for personal use; but it is there a basic rule like:
    et_CLICK: then it is BeforeAction == false
    I like to know for following event:
    et_CLICK
    et_COMBO_SELECT
    et_MATRIX_LINK_PRESSED
    et_MATRIX_LOAD
    et_CHOOSE_FROM_LIST
    et_MENU_CLICK
    Is there a Pattern for BeforeAction for ALL Item Events?
    Thank you,
    Rune

    Hi Rune,
    there's no real rule, because the events are different.
    but usual it is before/after displaying or before/after mouseup
    EventType | beforeaction = true | beforeaction = false
    et_CLICK | before you release the mouse button/Button is pressed | after you release the mousebutton
    et_ITEM_PRESSED | before you release the mouse button | after you release the mousebutton
    et_COMBO_SELECT | Selection has not changed | Selection has changed
    et_MATRIX_LINK_PRESSED | before you release the mouse button/Button is pressed | after you release
    et_MATRIX_LOAD | matrix is empty | matrix is loaded
    et_MENU_CLICK | Button is pressed/before release on menu item (without submenus)  | after release
    et_CHOOSE_FROM_LIST | before the Choose From List form is displayed | displayed
    any other questions ?
    greetings to montreal
    David

  • Matrix with ComboBox Column

    I want to make matrix with combobox column, it is not dificulte, but did somebody know is it posible with different values in each cell?
    first row ( 0, Zero ), ( 1, One )
    second row ( 0, Zero ), (2, Two ), (6, Six)
    third row ( 0, Zero), (1, One )
    .... ( Value, Description )
    I make something but all cell's have the same set of pair (Value, Description )
    P.S. Sorry for my english

    Hi Andy,
    I have been playing around with this for a while now and (seeing that Ibai actually already gave you a solution) I'm just gonna post where I am up to now. I have a matrix with two columns on it (c_1 and c_2). c_1 holds the value 1, 2 or 3. Whenever the user clicks on c_2 I repopulate the combo box according to the value selected in c_1. The only problem is that it shows the second last selected row and not the one that is currently selected. I am just posting it here so it can maybe someday put someone onto the right track.
            If pVal.FormTypeEx = "MainForm" Then
                If pVal.ItemUID = "m_List" Then 'Matrix
                    If pVal.ColUID = "c_2" Then 'Column 2
                        If pVal.BeforeAction = False Then
                            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
                                Dim oForm As SAPbouiCOM.Form
                                Dim oEdit As SAPbouiCOM.EditText
                                Dim oCombo As SAPbouiCOM.ComboBox
                                Dim oMatrix As SAPbouiCOM.Matrix
                                Dim oCol As SAPbouiCOM.Column
                                Dim i As Integer
                                oForm = oApplication.Forms.ActiveForm
                                oMatrix = oForm.Items.Item("m_List").Specific
                                oCol = oMatrix.Columns.Item("c_1")
                                oEdit = oCol.Cells.Item(pVal.Row).Specific
                                oCol = oMatrix.Columns.Item("c_2")
                                oCombo = oCol.Cells.Item(pVal.Row).Specific
                                For i = oCombo.ValidValues.Count - 1 To 0 Step -1
                                    oCombo.ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index)
                                Next
                                If oEdit.Value = "1" Then
                                    oCombo.ValidValues.Add("1", "One")
                                ElseIf oEdit.Value = "2" Then
                                    oCombo.ValidValues.Add("2", "Two")
                                    oCombo.ValidValues.Add("22", "TwoTwo")
                                ElseIf oEdit.Value = "3" Then
                                    oCombo.ValidValues.Add("3", "Three")
                                    oCombo.ValidValues.Add("33", "ThreeThree")
                                    oCombo.ValidValues.Add("333", "ThreeThreeThree")
                                End If
                            End If
                        End If
                    End If
                End If
            End If
    Hope it helps,
    Adele
    PS: Ibai, why do you have a new user name? You are the same Ibai Peña right?

  • Error in Choose from list  on Matrix

    Hi all,
       I am using CFL in matrix for my user define form, When i choose a value from CFL , i am getting the following error
    <b>" Item -Can't set value on item because the item can't get focus [66000-153]"</b>
    <u>the code i used is given below</u>
    <u>this is in Item Event</u>
                                        Try
                If FormUID = ("FRMIGRP") Then
                    If pVal.Before_Action = False Then
                        If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
                            ' If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
                            Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                            oCFLEvento = pVal
                            Dim sCFL_ID As String
                            sCFL_ID = oCFLEvento.ChooseFromListUID
                            Dim oForm As SAPbouiCOM.Form
                            oForm = SBO_Application.Forms.Item(FormUID)
                            Dim oCFL As SAPbouiCOM.ChooseFromList
                            oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                            If oCFLEvento.BeforeAction = False Then
                                Dim oDataTable As SAPbouiCOM.DataTable
                                oDataTable = oCFLEvento.SelectedObjects
                                Dim val As String
                                Dim val1 As String
                                Dim val2 As String
                                Dim val3 As String
                                Try
                                    val = oDataTable.GetValue(0, 0)
                                    val1 = oDataTable.GetValue(1, 0)
                                Catch ex As Exception
                                    MessageBox.Show(ex.Message)
                                End Try
                                Try
                                    If (pVal.ItemUID = "txtcode") Then
                                        Dim oDS As SAPbouiCOM.DBDataSource
                                        oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPHDR") 'add your dbdatasource here
                                        oDS.SetValue("U_grpcode", oDS.Offset, val)  ' val1 is the value you are setting
                                        oDS.SetValue("U_grpname", oDS.Offset, val1)
                                    End If
                                Catch ex As Exception
                                    MessageBox.Show(ex.Message)
                                End Try                      
                                Try
                                    val2 = oDataTable.GetValue(0, 0)
                                    val3 = oDataTable.GetValue(1, 0)
                                    If (pVal.ItemUID = "matr") And (pVal.ColUID = "supp") Then
                                       Dim oEdit As SAPbouiCOM.EditText
                                        oMatrix.FlushToDataSource()
                                        oForm.DataSources.UserDataSources.Item("EditDS2").ValueEx = val2.ToString
                                        oEdit = subcol.Cells.Item(pVal.Row).Specific
                                        oEdit.Value = val2.ToString
                                        oEdit = subname.Cells.Item(pVal.Row).Specific
                                        oEdit.Value = val3.ToString
                                        ("EditDS2").ValueEx = Nothing
                                    End If
                                Catch ex As Exception
                                    MessageBox.Show(ex.Message)
                                End Try
                            End If
    And i used data source also to set the value using below code, but for that also value is not set in to the field
    Dim oEdit As SAPbouiCOM.EditText
                                        Dim oDS As SAPbouiCOM.DBDataSource
                                        oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPDTL") 'add your dbdatasource here
                                        oDS.SetValue("U_supcode", oDS.Offset, val2)  ' val1 is the value you are setting
                                        oDS.SetValue("U_supname", oDS.Offset, val3)
    SOmebody can help me to solve this issue
    Regards
    Suresh R

    Suresh,
    Try this one,
    Here i have used for check the dulpicate entry also, that is if we choose one item in the first row in second row or third we cant able to choose the same. If u no need just neglect it.
    Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = False
                        Dim oCFLE As SAPbouiCOM.IChooseFromListEvent
                        oCFLE = pVal
                        Dim CFLID As String
                        CFLID = oCFLE.ChooseFromListUID
                        PI_Frm = app.Forms.Item(FormUID)
                        Dim oCFL As SAPbouiCOM.ChooseFromList
                        oCFL = PI_Frm.ChooseFromLists.Item(CFLID)
    oCFL.UniqueID = "CFL2" Then
                            Dim oDT As SAPbouiCOM.DataTable
                            oDT = oCFLE.SelectedObjects
                            Try
                                Dim oMat As SAPbouiCOM.Matrix
                                Dim t, t1 As String
                                Dim Rec, Rec1, Rec2 As SAPbobsCOM.Recordset
                                oMat = PI_Frm.Items.Item("m_det").Specific
                                t = oDT.GetValue(0, 0)
                                t1 = oDT.GetValue(1, 0)
                                If Trim(HEAD_oDBds.GetValue("U_pid", 0)).Equals("") = False Then
                                    oMat.Columns.Item("rate").Editable = False
                                Else
                                    oMat.Columns.Item("rate").Editable = True
                                End If
                                Dim Bool As Boolean = False
                                For i As Integer = 1 To oMat.VisualRowCount
                                    oMat.GetLineData(i)
                                    If Trim(DETAIL_oDBds.GetValue("U_itno", (i - 1))).Equals(Trim(oDT.GetValue(0, 0))) = True Then
                                        Bool = False
                                        Exit For
                                    Else
                                        Bool = True
                                    End If
                                Next
                                If Bool = True Then
                                    If pVal.Row = oMat.VisualRowCount Then
                                        oMat.AddRow()
                                        oMat.FlushToDataSource()
                                        Me.SetEmptyRow(DETAIL_oDBds.Size)
                                    End If
                                    Rec = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                    Rec1 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                    Rec2 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                    Rec.DoQuery("select BuyUnitMsr from OITM where ItemCode ='" & Trim(oDT.GetValue(0, 0)) & "'")
                                    DETAIL_oDBds.Offset = (pVal.Row - 1)
                                    DETAIL_oDBds.SetValue("LineId", DETAIL_oDBds.Offset, pVal.Row)
                                    DETAIL_oDBds.SetValue("U_itno", DETAIL_oDBds.Offset, oDT.GetValue(0, 0))
                                    DETAIL_oDBds.SetValue("U_itdesc", DETAIL_oDBds.Offset, oDT.GetValue(1, 0))
                                    DETAIL_oDBds.SetValue("U_unit", DETAIL_oDBds.Offset, Rec.Fields.Item(0).Value)
                                    DETAIL_oDBds.SetValue("U_poqty", DETAIL_oDBds.Offset, "0")
                                    DETAIL_oDBds.SetValue("U_qnos", DETAIL_oDBds.Offset, "0")
                                    DETAIL_oDBds.SetValue("U_pur", DETAIL_oDBds.Offset, "")
                                    Rec1.DoQuery("select U_basicrate from [@RATE_MASTER_DETAIL] where U_itemid='" & oDT.GetValue(0, 0) & "'")
                                    DETAIL_oDBds.SetValue("U_rate", DETAIL_oDBds.Offset, Rec1.Fields.Item(0).Value)
                                    Rec2.DoQuery("select a.OnHand ,b.ItemCode,b.DfltWH,a.WhsCode from OITW a,OITM b where a.ItemCode=b.ItemCode and b.DfltWH=a.WhsCode and b.DfltWH='01' and b.ItemCode='" & oDT.GetValue(0, 0) & "'")
                                    DETAIL_oDBds.SetValue("U_stx", DETAIL_oDBds.Offset, Rec2.Fields.Item(0).Value)
                                    oMat.SetLineData(pVal.Row)
                                End If
    If it helps give me reward points.
    Regards,
    Anitha

  • Can't get form items

    Hello everyone,
    I have a form that I loaded from a xml file created on Screen Painter.
    In my Item Event FORM_LOAD, I need to get it's items. I get the form with success, but the items count is always 0.
    Does anynoe has an idea why this is happening?

    When You load a form from XML all items are added after FORM_LOAD. That's why You don't have items frm.Items collection.
    You should acces to item just after vApp.Forms.AddEx(... YourNewFormCreationParameters ...).
          Dim fcp As SAPbouiCOM.FormCreationParams = vApp.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
          fcp.XmlData = My.Computer.FileSystem.ReadAllText("myNEwForm.srf"))
          Dim nFrm As SAPbouiCOM.Form = vApp.Forms.AddEx(fcp)
          nFrm.Items.Item("YourNewItemUID"). .....
    If You want to acces to items after Form_load You can use GOT_FOCUS Event (only if You have at least one editable item on this Form). BeforeAction should be False
      Public catchGF As Boolean = False
      Private Sub vApp_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles vApp.ItemEvent
          If pVal.FormTypeEx = "myNewFormUID" Then
            If pval.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pval.BeforeAction Then
              catchGF = True
            End If
            If pval.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS And catchGF And Not pval.BeforeAction Then
              'Now You can acces to your Item
              catchGF = False
            End If
          End If

  • Matrix actions and linking the Matrix-row to some fields

    Hello every One,
    I would like to have the following "action" ! I have a Form where i puted 2 edit fields and 1 matrix (Screen Painter), the matrix shows me the first and lost name of the Employee ( just an exp.).
    What i would like to do is to send these datas to the edit fields every time i choose another row. i cannt find any itemEvent for the raws to select the record in the data base and to bind it to the edit Fileds! is this a good way to do it ??
    Thank You for every help

    Hi Amir
    You can use the et_GOT_FOCUS event to check for focus on the Cells of the Matrix. I recommend using et_GOT_FOCUS because this will facilitate mouse and keyboard navigation.
    When you capture the event on the Matrix check the pVal.Row to get the row that received the Focus. Using this Row index retrieve the data from the Matrix and set the values for the required edit fields.
    <i>Remember to include event et_GOT_FOCUS in your EventFilters</i>
    <b>Event Handeling Example:</b>
    If pVal.BeforeAction = False Then
       If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
          'IDH_MTR - Matrix Item
          If pVal.ItemUID = "IDH_MTR" Then
             Dim oMatrix As SAPbouiCOM.Matrix
             oMatrix = oForm.Items.Item("IDH_MTR").Specific
             'Work with the DataSources of the
             'Edit Fields to avoid triggering the
             'Focus events again.
             ' * ED1 and ED2 is the DataSources for the
             '   Edit Fields
             ' * Column(1) And Column(2) contains the data
             '   that will be copied to the edit fields
             oForm.DataSources.UserDataSources.Item("ED1").Value = oMatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific.Value
             oForm.DataSources.UserDataSources.Item("ED2").Value = oMatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific.Value
           End If
        End If
    End If
    I hope this will help

  • Which LOV is attached to ordered item on sales order form

    Hello,
    I want to change the query of ordered item field on sales order form in Line items tab.
    I found that this field is using KFF as its LOV. KFF is "System Items" in Inventory application.
    But when I see the value set attached to the segment it is NONE type.
    My question is how can a NONE type of value set contain values

    Hi Joel,
    The problem may be with this line of code:
    int row = lineItemMatrix.GetNextSelectedRow(0, BoOrderType.ot_RowOrder)
    because this will get the row that is currently selected, however the menu will delete the row that currently has focus. You need to declare a row variable outside the scope of the events and set it on the got focus event.
    Sorry this example is in VB but you should get the idea:
    Dim Row As Integer = -1
    Private Sub Application_ItemEvent(ByVal FormUID As String, ByRef pVal As _
    SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles _
    Application_ItemEvent
        Dim Form As SAPbouiCOM.Form = Application.Forms.Item(FormUID)
        If Form.TypeEx = "139" And pVal.ActionSuccess = True And pVal.EventType = _
        SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
            If pVal.ItemUID = "38" Then
                Row = pVal.Row
            Else
                Row = -1
            End If
        End If
    End Sub
    Private Sub Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef _
    BubbleEvent As Boolean) Handles Application_MenuEvent
        Dim Form As SAPbouiCOM.Form = Application.Forms.ActiveForm
        If Form.TypeEx = "139" And pVal.BeforeAction = True And pVal.MenuUID = "1293" _
        Then
            If Row > -1 Then
                If ItemIslocked(Form, Row) = True Then
                BubbleEvent = False
                Application.StatusBar.SetText("You cannot delete a locked row.", _
                SAPbouiCOM.BoMessageTime.bmt_Short, _
                SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                End If
            End If
        End If
    End Sub

  • Item - Can't set value on item because the item can't get focus.  [66000-15

    hi i created one text box in purchase order form and asign the choose from list.l when i choose in edit box its show the following error-- Item - Can't set value on item because the item can't get focus
    Dim lonHeadDatasource As SAPbouiCOM.DBDataSource
    lonHeadDatasource = oOrderForm.DataSources.DBDataSources.Item("OPOR")
    oNewItem1 = oOrderForm.Items.Add("EditDS", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                        Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                        Dim oCFL As SAPbouiCOM.ChooseFromList
                        oCFLs = oOrderForm.ChooseFromLists
                        oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                        oCFLCreationParams.MultiSelection = False
                        oCFLCreationParams.ObjectType = "INTORDER"
                        oCFLCreationParams.UniqueID = "CFL1"
                        oCFL = oCFLs.Add(oCFLCreationParams)
                        oItem = oOrderForm.Items.Item("4")
                        oNewItem1.Top = 95
                        oNewItem1.Height = oItem.Height
                        oNewItem1.Width = 140
                        oNewItem1.Left = 125
                        oEdit = oNewItem1.Specific
                        oEdit.DataBind.SetBound(True, "OPOR", "U_EditDS")
                        oOrderForm.Items.Item("EditDS").Specific.ChooseFromListUID = "CFL1"
                        oEdit.ChooseFromListAlias = "U_ID"
    Item events
    Try
                If pVal.BeforeAction = False Then
                    If (pVal.FormType = 142) Then
                        Select Case (pVal.ItemUID)
                            Case "EditDS"
                                Select Case (pVal.EventType)
                                    Case SAPbouiCOM.BoEventTypes.et_GOT_FOCUS
                                    Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
                                        Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
                                        Dim bonCflList As SAPbouiCOM.ChooseFromList
                                        Dim bnnstrUID As String
                                        Dim bonDTTable As SAPbouiCOM.DataTable = Nothing
                                        bonCflEvents = pVal
                                        bnnstrUID = bonCflEvents.ChooseFromListUID
                                        bonDTTable = bonCflEvents.SelectedObjects
                                        bonCflList = oOrderForm.ChooseFromLists.Item(bnnstrUID)
                                        If pVal.BeforeAction = False Then
                                            If oOrderForm.Mode <> SAPbouiCOM.BoFormMode.fm_FIND_MODE Then
                                                If Not (bonDTTable Is Nothing) Then
                                                    If bonCflList.UniqueID = "CFL1" Then
                                                        If pVal.ItemUID = "EditDS" Then
                                                            Dim value As String = Nothing
                                                            oOrderForm.Items.Item("EditDS").Specific.value = bonDTTable.GetValue(0, 0)
                                                        End If
                                                    End If
                                                Else
                                                    lonHeadDatasource.SetValue("EditDS", lonHeadDatasource.Offset, "")
                                                End If
                                            End If
                                        End If
                                End Select
                        End Select
                    End If
                End If
            Catch ex As Exception
                SBO_Application.SetStatusBarMessage(ex.Message)
            End Try
    Thanks & Regards
    B.Narain

    Hi
    Instead of   oOrderForm.Items.Item("EditDS").Specific.value = bonDTTable.GetValue(0, 0) the following
    lonHeadDatasource.SetValue("U_EditDS", 0, bonDTTable.GetValue(0, 0))
    Regards
    Arun

  • How to Delete a Specific Cell in a Matrix + plz Give sample code for Lost F

    hello there !!!!
    i m in Great Trouble please help me out..
    i have to search for a specific Column n then i have to validate that portion, similarly after validating i have to add update delete all the fuction apply... so please help me i m very upset.
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim Count As Int32
                If FormUID.Equals("Allowance") Then
                    If (pVal.BeforeAction = True) And (pVal.ItemUID = "1") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                        If pVal.Row = 0 Then
                            'BubbleEvent = False
                        End If
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        Count = o_Matrix.RowCount()
                        SBO_Application1.MessageBox("Matrix Count is " & o_Matrix.RowCount)
                        Validate(pVal, EventEnum, FormUID, BubbleEvent)
                    End If
                End If
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
        Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim Row, ii As Integer
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            o_Matrix.FlushToDataSource()
            Try
                For Row = 2 To o_Matrix.RowCount
                    StrName = Convert.ToString(DBtable.GetValue("CardCode", Row - 1)).Trim()''' i got Error over there n rest of my code is also not working pls...
                    StrUId = Convert.ToString(DBtable.GetValue("U_AlwID", Row - 1)).Trim()
                    StrEnter = Convert.ToString(DBtable.GetValue("U_SupEnter", Row - 1)).Trim()
                    StrExist = Convert.ToString(DBtable.GetValue("U_SupExist", Row - 1)).Trim()
                    If Row - 1 < DBtable.Rows.Count - 1 Or (Not (StrName.Equals(String.Empty) And StrUId.Equals(String.Empty) And (StrEnter.Equals(String.Empty) Or StrExist.Equals(String.Empty))) And (Row - 1 = DBtable.Rows.Count - 1)) Then
                        If (Not StrName.Equals(String.Empty)) And ((StrUId.Equals(String.Empty) Or StrEnter.Equals(String.Empty)) Or StrExist.Trim.Equals(String.Empty)) Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                        For ii = Row To DBtable.Rows.Count - 1
                            If Convert.ToString(DBtable.GetValue("ColName", ii)).Trim().Equals(StrName.Trim()) Then
                                SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Duplication Not Allowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                                BubbleEvent = False
                                Exit Sub
                            End If
                        Next
                        If CDbl(StrName) < 0 Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                    End If
                Next Row
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

    Hello there
    sir i want to Add Update and delete these three basic operation onto the Matrix, Sir u game me a Sample code of Delete a specific Column...
    Sir can u do me a favour pls leave every thing n just told me how to update a matrix ,like i have to fill the matrix field through the DATABASE table now i want to update the DataBase table from the matrix..
    i just only know thta i have to fill back database table with the help of FLUSHTODATABASE()
    here is my Sample Code...n i have to update in the validate portion...
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim oCellValue As SAPbouiCOM.EditText
                If FormUID.Equals("Allowance") Then
                    If (pVal.ItemUID = "MatAllow") Then
                        If pVal.Row = 0 Then Exit Sub
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        If (pVal.Row > o_Matrix.RowCount) Then Exit Sub
                        oForm = SBO_Application1.Forms.Item(FormUID)
                        If (pVal.ItemUID = "1" Or EventEnum = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                            If pVal.ColUID = "ColName" And pVal.BeforeAction = True Then
                                If pVal.Row = 0 Then Exit Sub
                                oCellValue = CType(o_Matrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific(), SAPbouiCOM.EditText)
                                If (oCellValue.Value.Trim().Equals(String.Empty) And o_Matrix.RowCount <> pVal.Row) Then
                                    SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Blank Value Not Allowed", )
                                    oCellValue.Active = True
                                    BubbleEvent = False
                                    Exit Sub
                                End If
                            End If
                        End If
                    End If
                End If
                Validate(pVal, EventEnum, FormUID, BubbleEvent)
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
    Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim str, str1 As String
            Dim checkbox1, Checkbox2 As SAPbouiCOM.CheckBox
            Dim o_Matrix As SAPbouiCOM.Matrix
            Dim Sum As Integer
            Dim oRecordset As SAPbobsCOM.Recordset
            Dim Container As Integer
            Dim Count As Int32
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            oRecordset = o_CompanyObj.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            Try
                For Count = 0 To DBtable.Rows.Count - 1
                    CodeFill = Convert.ToString(DBtable.GetValue("Name", Count).Trme())
                    NameID = Convert.ToString(DBtable.GetValue("ColUID", Count).Trim())
                    Price = Convert.ToString(DBtable.GetValue("ColPrice", Count).Trim())
                    Quantity = Convert.ToString(DBtable.GetValue("ColQuant", Count).Trim())
                    Total = Convert.ToString(DBtable.GetValue("ColTotal", Count).Trim())
                    checkbox1 = o_Matrix.Columns.Item("ColSEnter").Cells.Item(Count).Specific
                    Checkbox2 = o_Matrix.Columns.Item("ColSExist").Cells.Item(Count).Specific
                    If (checkbox1.Checked = True) And (Checkbox2.Checked = True) Then
                        Dim Sql As String
                        Sql = "Update [@Supplier] Set U_Price=' " & Price & " ',U_ID=" & NameID & "Where Name ='" & CodeFill & " '"
                        oRecordset.DoQuery(Sql)
                    End If
                Next Count
                SBO_Application1.MessageBox("Record was Updated")
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

  • Unable to capture Action_Success event during update

    Hi I am using SAP-B1 2004. Using UIAPI, i am trying to do something when an item information in item master is updated.
    On update button click i am capturing the Before_Action =True event to do something. If the Item information is successfully updated, i am trying to capture Action_Success = True event to do something.
    The problem i am encountering is that, the Action_Success event is not getting fired.
    After Before_Action =True , Before_Action =false event is getting fired and after that the item uid value changes from 1 (for update button) to some other value.
    Any idea why this is happening? My code is as follows:
    If pVal.FormType = 150 And pVal.FormMode = 2 Then
       If pVal.ItemUID = "1" And pVal.EventType =   
           et_ITEM_PRESSED And pVal.Before_Action = True Then
           **Do Something***
       End If
       If pVal.ItemUID = "1" And pVal.EventType = 
           et_ITEM_PRESSED And pVal.Action_Success = True Then
           **Do Something***
       End If
       If pVal.ItemUID = "1" And pVal.EventType = 
          et_ITEM_PRESSED And pVal.Action_Success = false Then
           **Do Something***           
       End If
    End If
    Thanks.

    Just change the second condition from
    If pVal.ItemUID = "1" And pVal.EventType =
    et_ITEM_PRESSED And pVal.Action_Success = True Then
    to
    If pVal.ItemUID = "1" And pVal.EventType =
    et_ITEM_PRESSED And pVal.BeforeAction = false Then
    and forget ActionSuccess.
    If there is an error in between, the "et_ITEM_PRESSED pVal.BeforeAction = false" is not sent. This means, whenever you get the event "et_ITEM_PRESSED pVal.BeforeAction = false", the action actually was successful.
    You may want to test it with following proof-snippet:
    If pVal.FormType = 150 And pVal.FormMode = fm_UPDATE_MODE Then
        If pVal.ItemUID = "1" And pVal.EventType = _
            et_ITEM_PRESSED And pVal.Before_Action = True Then
            Debug.Print "before"
        End If
        If pVal.ItemUID = "1" And pVal.EventType = _
            et_ITEM_PRESSED And pVal.Before_Action = False Then
            Debug.Print "after"
        End If
        If pVal.ItemUID = "1" And pVal.EventType = _
            et_ITEM_PRESSED And pVal.Action_Success = True Then
            Debug.Print "success"
        End If
        If pVal.ItemUID = "1" And pVal.EventType = _
            et_ITEM_PRESSED And pVal.Action_Success = False Then
            Debug.Print "no success"
        End If
    End If
    Case 1: Update successful
    Output: before, after, no success
    Case 1: Update fails
    Output: before, no success
    Means: forget ActionSuccess, use BeforeAction true/false.
    (That's how solved the problem did it when I encountered the same problem.)
    Problem is, you're not able to to something if there was an error. But why would you want to? User sees a red error message and tryes again...
    Florian
    Message was edited by: Florian Zeller

  • Event dead loop in updating column value of a matrix

    Hi,
    I need to do some auto calculation in a matrix. In my matrix, i have column A and B. If user enter a value in column A and leave the column then my add-on will do some calculation and assign a new value to column B, same thing on column B. In my event filtering, i use
    "pVal.FormType == xxx && pVal.ItemUID == "xx" && pVal.ColUID == "U_xx" && pVal.EventType == SAPbouiCOM.BoEventTypes.et_LOST_FOCUS && !pVal.BeforeAction"
    to capture the event. But then my add-on enter into a dead loop. It seems when i write a value to column B in column A event it will trigger LOST_FOCUS event in column B and then it trigger same event of column A, and then it enters into a dead loop. In SAP B1 client, i can see the two columns start refreshing endlessly.
    Apparently, when assigning a value into a column B during event of column A, it will trigger LOST_FOCUS event of column B. That's the only reason i strongly suspect that.  Is there any one know the solution for my situation?
    Thanks,
    Lan
    P.S. i first get the object of the textbox in the matrix, and use "oEditText.value = new_value" to assign the value.
    Edited by: ZHANGLAN on Jul 8, 2010 2:26 AM

    Hi
    Why didn't you try the Validate event instead of Lost focus. That is pretty easy for such calculations.
    "pVal.FormType == xxx && pVal.ItemUID == "xx" && pVal.ColUID == "U_xx" && pVal.EventType == SAPbouiCOM.BoEventTypes.et_Validate && !pVal.BeforeAction"
    Thanks
    Anoop

  • How to get a UDF value inside print event.

    I'm designing an add-on that will print 3 labels based on different criteria when and Invoice or a Delivery ticket is print.  Each label will go to a different printer since these are specifilly dedicated to each type of label/form.
    My problem is that that I have 2 UDF in the header of the marketing documents (Y/N fields) that flag me when 2 of the labels needs to be printed.  I have tried unsuccessfully to get the value from the UDF items in the form, I got several information like cardname, shipto address and total from the marketing document form, but no UDF can be access. 
    Below find copy of my routine (tPOTD is my UDF), this code will only work if there is only one instance of the form open, now is there's a way of knowing the instance number of a specific form?
    Private Sub SBO_Application_PrintEvent(ByRef printeventInfo As SAPbouiCOM.PrintEventInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.PrintEvent
            Dim s As String
            Dim DocType As String
            Dim oForm As SAPbouiCOM.Form
            Dim tInvNum As SAPbouiCOM.EditText
            Dim tName As SAPbouiCOM.EditText
            Dim tshipto As SAPbouiCOM.EditText
            Dim ttotal As SAPbouiCOM.EditText
            Dim tPOTD As SAPbouiCOM.ComboBox
            If printeventInfo.BeforeAction = True And printeventInfo.PrintEventType = SAPbouiCOM.BoPrintEventTypes.pet_Print Then
                oForm = SBO_Application.Forms.Item(printeventInfo.FormUID)
                If oForm.TypeEx = "133" Or oForm.TypeEx = "60090" Then
                    DocType = "Invoice"
                Else
                    DocType = "Delivery"
                End If
                tInvNum = oForm.Items.Item("8").Specific
                tName = oForm.Items.Item("54").Specific
                tshipto = oForm.Items.Item("92").Specific
                ttotal = oForm.Items.Item("29").Specific
    ' Next line is to get the value of the UDF but it fails finishing the routine and no exceptions raise
                tPOTD = SBO_Application.Forms.GetForm("-" + oForm.TypeEx, oForm.TypeCount - 1).Items.Item("U_PrintOTD").Specific
                s = tName.Value + Chr(13) + Chr(10) + Replace(tshipto.Value, Chr(13), Chr(13) + Chr(10)) + Chr(13) + _
                    Chr(10) + Chr(13) + Chr(10) + DocType + ": " + tInvNum.Value + "   Total: " + ttotal.Value
            End If
    EndSub

    First off, do you have the UDF form visible?  If not, I'm not aware of a way to retrieve the UDF data without the DI-API.
    Assuming you're printing with the form active, you can use the SBO_Application.Forms.ActiveForm.TypeCount value to obtain the "instance" of the form, I'd guess.  I haven't tried it, but I assume it would work:
    UDFForm = SBO_Application.Forms.GetFormByTypeAndCount(-133, SBO_Application.Forms.ActiveForm.TypeCount)
    Then your field would be:
    UDFValue = oUDFForm.Items.Item("U_MYFIELD").Specific
    Message was edited by:
            Curtis Fry

  • CFL For the edit text using screen painter

    Dear All,
    I had created CFL for the Edit box to display CardCode
    if i press tab button the list for the specified object type is obtained
    but the selected value is not binded with the edit box,i have attached the code here,
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                Dim oForm As SAPbouiCOM.Form
                oForm = SBO_Application.Forms.Item(FormUID)
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                If oCFLEvento.BeforeAction = False Then
                    Dim oDataTable As SAPbouiCOM.DataTable
                    oDataTable = oCFLEvento.SelectedObjects
                    Dim val As String
                    Try
                        val = oDataTable.GetValue(1, 0)
                    Catch ex As Exception
                    End Try
                    If (pVal.ItemUID = "23") Then
                        oForm.DataSources.UserDataSources.Item("CardCode").ValueEx = val
                    End If
                End If
            End If
    Regards,
    Vijay

    Is the event generated ? What is the value of your "val" variable ?

Maybe you are looking for

  • XI--- OpenJMS error  Object not found in lookup of XIJMSService

    Hi all, I am trying XI-->OpenJms (Server). I have included openJms.jar library in aii_af_jmsproviderlib.sda and deployed using SDM. In JMS receiver adapter I am using the following Configuration: Transport protocol: JMS Provider with JNDI . Queue con

  • Merged files not opening correctly from TOC

    Hi, We are having issues with one of our merged .chms. It is a small .chm with one topic and 8 merged TOCs. When this .chm file is compiled, the TOC works fine and all the TOC topics open and the topics display correctly in the right-hand frame. Howe

  • Trouble to access "App" in Creative Cloud

    Hola, actualice OS X Yosemit > instale Creative Cloud para descargar la versión de prueba de Dreamweaver, pero no me ha sido posible, se queda procesando y no accede a la sección de Apps, por lo tanto no he podido descargar el programa ¿Podrían ayuda

  • Weird iTunes problem!! HELP

    Hi, I've bought this brand new computer with Windows Vista Ultimate 64bit and everytime I open iTunes I get the message that iTunes is not propperly installed. I had this a couple of versions before and everytime a new version was released I download

  • Downloadidng adobe photoshop elements 11

    I purchased photoshop elements 11 & adobe premier elements 11 in a high street store.  Adobe.com appears to only allow the downloading of software purchased in the online store.  Tips please on how I can download my purchase which has been registered