Matrix Events

Hi All,
  I have a matrix in my form i need this is to work like the one in Purchase Order.
  In Purchase order matrix If you press tab from Item No column choose from list will appear at the same time if we click on the Owner EditText below the matrix the focus will shift to it.
  In the same way i will pop up the choose from list from Item No column in my matrix in my form it works fine. but when ever i click on the EditText below the matrix the same choose from list which i set for the Item No column is getting pop up. The Focus is not shifting to the edit text.
  Can any one say in which event i should do that?
Manoj

Hi Manoj,
Tabing of the field will make it lose focus. Thus you want to pop your CFL on the lost focus event of all the items you are interested in (matrix cell, edit text etc.)
Thus you'll be looking at
<b>If pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS Then
'Your CFL Code
end if</b>

Similar Messages

  • 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

  • Problem trapping event in a matrix SBO 2004

    Hi
    I am trying to trap when the lost focus event in a matrix, so if the cell is empty I want to put the focus back into that cell and call a formatted search
    I can't seem to get the cursor to go back to the original cell. Can anyone help please ?
    Regards Andy
        Case et_LOST_FOCUS:
        ' check if parish code is empty in posts matrix
        If pVal.formuid = "CONTACTS" And pVal.ItemUID = "228" And pVal.ColUID = "u_dpcode" And pVal.Before_Action = False Then
          Set oform = SBO_Application.Forms(formuid)
          Set omatrix = oform.Items("228").Specific
          If Trim(omatrix.Columns("u_dpcode").Cells(pVal.Row).Specific.String) = "" Then
            omatrix.Columns("u_dpcode").Cells.Item(pVal.Row).Click ct_Regular
            ' SBO_Application.SendKeys ("+{F2}")
          End If
          Set omatrix = Nothing
          Set oform = Nothing
        End If

    Hi Paul,
    Have you debuged the app and ensure if this line is executed?
    omatrix.Columns("u_dpcode").Cells.Item(pVal.Row).Click ct_Regular
    Which version is it?
    in 2005, the Validate and Before_Action = true event is rised too, and you could use it to set the BubbleEvent to false(In 2004 it is not rised).
    Regards,
    Ibai Peñ

  • Event Select Rows in Matrix

    Hi,
    I'm have one form made in Screen Printer with one matrix. How do you create the event "select row" in a matrix so that when one double-clicks on the row, the informations goes to form on SBO Apllication ?
    For example,
    When you type ' * ' in the ItemNumber field and "Enter" in the form "Item Master Data",  the form " Find (List of Itens)" opens up. This form opens the matrix with all itens and when you double-click on a row  the information of that specific item goes to the Item Mater Data Form.
    The language is C#.
    Could someone help me out?
    Grateful,
    Fabio.

    Hi David,
    Thank you for you answer. But, the question is...how to copy the informations from the fields of my form to the fields SAP form, when the event is to give double-click in row on the matrix of my form.
    sorry my English, but is not another way
    Grateful,
    Fabio.

  • Menu Events in Matrix

    Hello,
    I created an UDO with Document and Document Lines.
    The Document Lines reside in a Matrix.
    Everything works fine but:
    The System Menus like "Delete Row(Ctrl+K)" are disabled while working in this UDO Form.
    How can I fix this?
    Can someone help?
    Thanks in advance.
    Rudy.
    Message was edited by: Ruediger Gertz

    Hello Trinidad,
    thank you for you promptly answer.
    Yes. The form mode is changing, but the addon don't receive the event(sometimes).
    For the 2nd problem: How can I receive the keyboard shortcut "Ctrl+K" while the cursor is in the matrix.
    I would like to remove the system "row delete" menu temporarly and replace it with my own menu entry. But I want to keep the normal usability for the user (Ctrl+K = remove a line from the matrix).
    Is there a chance to do something like that?
    In my own event tracker tool, I can't see any event fired, when I type Ctrl+K while the curser is in a matrix cell...
    Thank you in advance.
    Rudy.
    Message was edited by: Ruediger Gertz

  • Multiple validate events generated for a new matrix

    I have added a new tab to the item master form which has a matrix grid on it.
    This works fine until I attempt to move to the previous or next record whilst the new tab is visible.
    What happens then is that every column on every line of the matrix causes a validate event to be triggered, it even triggers the event for hidden columns.
    This is really affecting my form and I cannot understand why so many events are generated, does anyone have any odeas?
    I am not sure if it is relevant but I have noticed that when moving through the data a click event is generated on item 41 within the item master form but i am not certain what this item is - could it be the "Move data" button from the toolbar?
    Gordon Wood

    Hi ...
    I would try putting a BubbleEvent = False at a certain point in the event to cancel further execution.
    You could also use the iteration of If pval.InnerEvent = True to catch and further execution, like this
          CASE et_Validate
                   If pval.InnerEvent = True Then BubbleEvent = False
    hope it helps

  • Re:Adding a row in a matrix using Lost_Focus event & deleting a row

    Dear All,
    Iam facing a problem in adding a row in a matrix using last focus event.its like if i keep the cusor in the last coloumn in a matrix n if i press tab it should add a row .the row is getting added the problem here is the cursor is gng to first row but it should come to the second row.
    the second problem is while deleting a row the row is getting deleted but the row count is showing the deleted row no.
    pls suggest a solution for these problems.
    Thanks & Regards
    Anand

    Hi,
    If pVal.BeforeAction = False Then
                Select Case pVal.EventType
                    Case SAPbouiCOM.BoEventTypes.et_KEY_DOWN
                        If pVal.ItemUID = "matlab" And pVal.ColUID = "mtimeout" And pVal.CharPressed = 9 Then
                            oMatrix = oForm.Items.Item("matlab").Specific
                            Dim rc As Integer = oMatrix.VisualRowCount
                            If rc = pVal.Row Then
                                addrow()    'funtion for adding row
                                oMatrix.Columns.Item("labc").Cells.Item(oMatrix.RowCount).Click()
                                'SBO_Application.MessageBox(oMatrix.RowCount)
                            End If
                        End If
    This is the function i hav used
    Private Sub addrow()
            Try
                If (oForm.UniqueID = "updt") Then
                    oForm = SBO_Application.Forms.ActiveForm
                    oForm = SBO_Application.Forms.Item("updt")
                    omatrix = oForm.Items.Item("matlab").Specific
                    omatrix.AddRow(1, omatrix.VisualRowCount)
                    Dim rc As Integer = omatrix.VisualRowCount
                    'SBO_Application.MessageBox(rc)
                    otext1 = omatrix.Columns.Item("mdatein").Cells.Item(rc).Specific
                    otext1.String = "s" 'RecSet.Fields.Item("date1").Value
                    otext1 = omatrix.Columns.Item("mdateout").Cells.Item(rc).Specific
                    otext1.String = "s" 'RecSet.Fields.Item("date1").Value
                    End If
            Catch ex As Exception
                SBO_Application.MessageBox(ex.Message)
            End Try
        End Sub
    this is the code which m using
    Regards,
    Anand

  • How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    Hi,
    Sorry, we do not support a matrix-question field.   Please try the multilines text field (where your participant can enter multiple lines in the input text box) and see if it works for you.
    Thanks,
    Lucia

  • Trap the Correct Event to manipulate matrix

    Hi expert,
    another question from me
    I need to modify value in a standard form (Quotation Form).
    When the user change the "ItemCode" value I want to change the value in some UDF (User Defined Field) in the row.
    The UDF i want to change is named "U_II_001"
    What is the correct event I have to trap?
    Actually I use the event et_CHOOSE_FROM_LIST .
    As you can see, if the event is from column "1" (ItemCode) I call two different methods:
    1) ReadItemCode
    2) AddNewValueInRow
    1) return a string value that contains the "ItemCode" value.
    This work as well.
    Problem is when I call the second method, "AddNewValueInRow"
    Program add the new value in the UDF field, but I cannot add new lines just like if the CHOOSE_FROM__LIST action did dot finish:
    if (pVal.ItemUID == "38" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST & pVal.Before_Action == true)
                        // Item Code
                        if (pVal.ColUID=="1")
                            string oValore;
                            oValore = ReadItemCode(pVal) ;
                            AggiungiValoriNellaRiga(pVal, oValore);
    The ReadItemCode code:
            private string ReadItemCode( SAPbouiCOM.ItemEvent pVal )
                SAPbouiCOM.Matrix oMatrix;
                SAPbouiCOM.EditText oValore;
                oMatrix = (SAPbouiCOM.Matrix)oQuotationForm.Items.Item("38").Specific;
                oValore = (SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(pVal.Row).Specific;
                return oValore.Value;
    The AddNewValueInRow code:
            private void AddNewValueInRow(SAPbouiCOM.ItemEvent pVal, string oValore)
                SAPbouiCOM.Matrix oMatrix;
                SAPbouiCOM.EditText oDestinazione;
                oMatrix = (SAPbouiCOM.Matrix)oQuotationForm.Items.Item("38").Specific;
                oDestinazione = (SAPbouiCOM.EditText)oMatrix.Columns.Item("U_II_001").Cells.Item(pVal.Row).Specific;
                oDestinazione.Value = oValore;
    Now, what i'm doing wrong?
    What is the correct event I need to trap?
    If i trap the et_VALIDATE event, system freeze...
    thanks in advance,
    Jonny Cortonicchi

    Hi Jonny,
    Trap the et_VALIDATE event.
    Use function oMatrix.SetCellWithoutValidation to prevent system freeze.
    Regards,
    Benno Janssen

  • Right-Click Event Matrix

    Good Morning
    Experts:
    I have added several options(SAP and Custom) to the Right-Click event.  It works as designed when Right-Clicking on the Matrix.  However, when Right-Clicking anywhere else on the screen, the options are still displayed.
    How can I restrict the options to only be displayed when Right-Clicking on a Matrix?
    Thanks,
    EJD

    Hi Ed,
    The right click event is completely separate event (ie it is not an EventType within the ItemEvent).
    So to code it (C#):
    private void _sboApp_RightClickEvent(ref SAPbouiCOM.ContextMenuInfo EventInfo, out bool BubbleEvent)
         BubbleEvent = true;
         if(EventInfo.FormUID == "MYFORM")
              // Do some stuff
    You also need to have defined the event while initialising the application object:
    this._sboApp.RightClickEvent += new SAPbouiCOM._IApplicationEvents_RightClickEventEventHandler(this._sboApp_RightClickEvent);
    There's an example project in the UI section of the SDK samples (number 22).
    Kind Regards,
    Owen

  • Make Double Click event on Row, Matrix

    Hi All,
    I'm new in SDK and sorry for my English.
    Please show me how to make double click event on Row of  Matrix, i have created a table contain all Draft which Docstatus is open and order by ObjType(DocType), but i can't using Link Button on DocNum Column to view Object Detail . I think another way to do that is make a double click event on each row of matrix. Can I do like that ? plz show me . Thank for any suggestion.
    Thanks

    Hi Shafi,
    This is my .srf file
    <items><action type="add"><item uid="MTX_Data" type="127" left="15" tab_order="0" width="620" top="41" height="285" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1"><AutoManagedAttribute /><specific SelectionMode="2" layout="0" titleHeight="19" cellHeight="19" TabOrder="0">
    This is my code draw a form with matrix
    Private Sub DrawForm()
            Try
                'Read File interface
                LoadFromXML("DraftOpen.srf")
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
            oForm = SBO_Application.Forms.Item("DRFOPEN")
            ' Add Items       
            ' Add a matrix
            oMatrix = oForm.Items.Item("MTX_Data").Specific
            oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
    This is my event
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            If pVal.FormUID = "DRFOPEN" And pVal.ItemUID = "MTX_Data" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK And pVal.BeforeAction = True Then
                Try
                    oForm = SBO_Application.Forms.Item("DRFOPEN")
                    Dim omatrix As SAPbouiCOM.Matrix
                    omatrix = oForm.Items.Item("MTX_Data").Specific
                    If omatrix.RowCount > 0 Then
                        For i As Integer = 1 To omatrix.RowCount
                            If omatrix.IsRowSelected(i) = True Then
                                MessageBox.Show(omatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific.value)
                                MessageBox.Show(omatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific.value)
                            End If
                        Next
                    End If
                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try
            End If
    please help me to check this code. i don't know why it's still not working with double click event. sorry to disturb you.
    Edited by: PeterHoang on Aug 30, 2011 10:15 AM

  • Right click event on a matrix

    Hi All
    I have to capture the right click event on a matrix
    here is my code
    <B1Listener(BoEventTypes.et_RIGHT_CLICK, True)> _
            Public Overridable Function OnBeforeRightClick(ByVal pVal As ContextMenuInfo) As Boolean
                Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
                'ADD YOUR ACTION CODE HERE ...
                If pVal.ItemUID = "matItems" Then
                    ' do something
                End If
                Return True
            End Function
    the problem is that pVal.ItemUID always return null.
    Can any one help me
    Regards
    Arun TB
    Edited by: aruntb on Jul 14, 2010 9:39 PM

    Solved

  • Any way to update a matrix cell without events being produced in B1 8.8

    Hi
    I have written some code to update the gl code column in the sales order matrix depending on a field value
    This works fine but generates the usual screen flicker / events being produced
    I update it using -
    matrix.Columns.Item("159").Cells.Item(pVal.Row).Specific.STRING = recset.Fields.Item(0).Value
    Is there a faster to do this please ?
    I have tried the new matrix.SetCellWithoutValidation command but this only works on udf fields
    Thanks for any ideas
    Regards Andy

    Hello Andy,
    You may read this thread to prevent your addon from re-processing the entered data.
    Freezing the form is also good idea.
    Regadrs
    János

  • Cant add Rows In a Matrix (Child) and No event catching

    Hi,
    I created a Master File and its Child. Registered as an UDO. Created an UDO Form with the UDO Form Generator.
    I Can Add, find, update, records to de Master File, but The Matrix related to the Child Table Only allows me enter information in the first Row.
    I Have tried the addrow command in every place possible, but It doesnt work.
            Dim oXmlDoc As Xml.XmlDocument
            oXmlDoc = New Xml.XmlDocument
            Dim sPath As String
            sPath = IO.Directory.GetParent(Application.StartupPath).ToString
            oXmlDoc.Load(sPath & "" & FileName)
            SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
            oForm = SBO_Application.Forms.Item("F_MX_C071")
    The last thing I tried was include this next lines after
            oItem = oForm.Items.Item("mtx_0")
            oMatrix = oItem.Specific
            oMatrix.AddRow(3)
    I Also Cant catch the AddRow Event Button. I Set the filters and the event handling for menus and
            oFilters = New SAPbouiCOM.EventFilters
            oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
            oFilter.AddEx("F_MX_C071")
            SBO_Application.SetFilter(oFilters)
    If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
    Events are catched before oForm = SBO_Application.Forms.Item("F_MX_C071"). After that, there´s no event catching
    Can anyone help me? I have a lot of time spent in this issue.
    Thanks a lot.

    I dont know if Is it clera for me now, but i try it.
    You have matrix on user form. The matrix contains child data. This child data are inserted to matrix manualy or bounded to some datatable, i think with datatable?
    When you add new line to matrix, Im using
    omatrix.AddRow(1, 0) - 1 is that I want to add 1 row, 0 is position, where the new line will be in matrix
    When the matrix is filled with code, Im doing it as
    I update usertable
    oUserTable.UserFields.Fields.Item("U_Popis").Value = ""
    oUserTable.UserFields.Fields.Item("U_PATH").Value = ed.String
    then update the form to affect changes to db
    oOrderForm.Update()
    and then I make new bounding to datatable.
    Undestand I correctly it now?

  • Matrix Row Click Event

    Dear Support Team,
    I want to populate another matrix on clicking a row of a matrix.  which event should i capture.
    Thanking you
    Pradnya

    Hi Pradnya
    Hi you can use after click event on the # column ( or any other column as per your requirement )
    <B1Listener(BoEventTypes.et_CLICK, False)> _
            Public Overridable Sub OnAfterClick(ByVal pVal As ItemEvent)
                Dim ActionSuccess As Boolean = pVal.ActionSuccess
                Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
                Dim item As Item = form.Items.Item("mtx1")
                Dim matrix As Matrix = CType(item.Specific, Matrix)
                'ADD YOUR ACTION CODE HERE ...
                If pVal.ItemUID = "mtx1" Then
                       If pVal.ColUID = "V_-1" Then  '# clumn id
                                    ' Write code for populating the matrix  
                    End If
                End If
            End Sub
    Hope this will help You
    Regards
    Arun

Maybe you are looking for