Sorting UDO Matrix

Hi,
I need help in the following:
1. How to sort or group UDO table(s) using conditions
2. How to enable double-click on column header in UDO matrix
I am using VB and 2004B. Your input will be greatly appreciated.

To my knowlegde this can't be done yet. Not in SBO2004A or in SBO2005A... Sort was part of the planned release of 2005A but it didn't make it before the release. Now the plan is SBO2005A SP1... I don't know the release plan form the B-Cluster...

Similar Messages

  • UDO matrix sort

    Hello All:
       Currently have a UDO that user users, as it get larger there is a need to have the matrix value sorted by a different way (default of course is alphabetically against code column).
       Aside from write a new form and handle data source of the matrix myself. Any easier I can resort the exist UDO matrix?
       Thank you for any help you can give me.
    Also.
        I am having a weired problem that when I change viewpanel, element does not change.
        I set the item's frompanel and topanel.. And I have the handling script that does "form.PaneLevel = " thing. I know it is something stupid as I done something like this before and stuck on this a bits before and fixed before. But that was several years ago. Can't remember what I did. Any obvious suggestion would be greatly appreciated. First part of this message is more important!
    Thank You!

    Matrix columns can be sort using this code
    yourmatrix.Columns.Item("yourcolumn").TitleObject.Sortable = true;
    when you click on matrix column header the column will sort automatically

  • Udo matrix -save problem

    Hi,
    i am creating a form by using UDO form generator.
    in that documet and doucument rows are existed. if user select the combobox value from the form, by taking that value and i am generating a query, i am generating a recordset. by using Userdatasources i am binding each column in matrix.
    i binded all values to the matrix successfully. but
    but when i press Add button, this matrix rows are not getting saved. and also if i have two rows, when i press add, in database only one row is adding with NULL values. how to save that matrix data?
    please help me urgent
    asap
    regards,
    nagababu

    I believe this is a duplicate of
    Udo matrix rows saving problem
    Pls read the guidelines. Don't duplicate requests, this just cause confusion and
    inefficiency in the forum. And pls remember that this is a community of very very
    busy developers, each of them with his/her "urgencies" ....

  • Dynamic condition in UDO Matrix's Column

    Hi all,
    I have a user form with a matrix. The matrix's first column has a CFL linked to another UDO MasterData Code (lets call it UDOCode).
    And on this matrix, the same UDOCode cannot be chosen more then once.
    So, I've been trying to code a dynamic CFL that filters the UDOCode's already chosen in the Column.
    Based on this thread I've achived this code:
    Select Case pVal.ItemUID
                        Case "mtx_ACORDO" '// The Matrix
                            oConds = New SAPbouiCOM.Conditions
                            With oForm.DataSources.DBDataSources.Item("@ADAT_ACORDOS1") '// The Matrix's DBDataSource
                                If .Size = 1 Then
                                    oCond = oConds.Add
                                    oCond.Alias = "Code"
                                    oCond.Operation = BoConditionOperation.co_NOT_NULL
                                Else
                                    For i As Integer = 0 To .Size - 1
                                        oCond = oConds.Add()
                                        oCond.BracketOpenNum = 1
                                        oCond.Alias = "Code"
                                        oCond.Operation = BoConditionOperation.co_NOT_EQUAL
                                        oCond.CondVal = .GetValue("U_EspPrcCd", i)
                                        oCond.BracketCloseNum = 1
                                        If i > 0 And i < .Size - 1 Then
                                            oCond.Relationship = BoConditionRelationship.cr_OR
                                        End If
                                    Next
                                End If
                            End With
                    End Select
    If Not oConds Is Nothing Then oCFL.SetConditions(oConds)
    In the matrix's first row I have no problem. All the values are there. But on the second row, no values are display in the DataTable.
    If I change the conditions from .Size -1 to .Size - 2, I get the correct values on the first and second rows, but on the third, again, no values are being display in the DataTable...
    Can anyone help me?
    Regads,
    Vítor Vieira
    Edited by: Rui Pereira on Dec 23, 2008 4:17 PM

    Hi, Erwine Sukardy
    Maybe it will be helpful if you have a specific task.
    All of items on a Form have it's own DBDataSources.
    For example, to get a table name and field name, that are Datasources to the ItemCode field in a Matrix in a  Purchase Order document, you can use this code:
    SAPbouiCOM.Matrix        tblSNs;
    SAPbouiCOM.Column      oColumnItems;           
    tblSNs = (SAPbouiCOM.Matrix)oPurDNForm.Items.Item("38").Specific;
    oColumnItems = (SAPbouiCOM.Column)tblSNs.Columns.Item("1");
    string tableName = oColumnItems.DataBind.TableName;
    string fieldName = oColumnItems.DataBind.Alias;
    HTH!

  • Udo matrix rows saving problem

    Hi,
    i am creating a form by using UDO form generator.
    in that documet and doucument rows are existed. if user select the combobox value from the form, by taking that value and i am generating a query, i am generating a recordset. by using Userdatasources i am binding each column in matrix.
    i binded all values to the matrix successfully. but
    but when i press Add button, this matrix rows are not getting saved. and also if i have two rows, when i press add, in database only one row is adding with NULL values. how to save that matrix data?
    i am sending my code here. plz help me
    ds = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    ds.DoQuery("select a.code as Code,b.Itemname as Desc1,a.quantity as Quantity from itt1 a,oitm b where a.code=b.Itemcode and a.code=' " & oComboBox.Selected.Value & ' "")
    'User datasources creation
    oForm = SBO_Application.Forms.Item("TBL_JOBWORK_")
    oUserDataSource = oForm.DataSources.UserDataSources.Add("dsItemcode", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
    oUserDataSource = oForm.DataSources.UserDataSources.Add("dsItemdesc", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
    oUserDataSource = oForm.DataSources.UserDataSources.Add("dsQuantity", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
    ds.MoveFirst()
    oForm = SBO_Application.Forms.Item("TBL_JOBWORK_")
    oItem = oForm.Items.Item("mtx_0")
    oMatrix = oItem.Specific
    oColumns = oMatrix.Columns
    Dim oColumn1 As SAPbouiCOM.Column
    Dim oColumn2 As SAPbouiCOM.Column
    Dim oColumn3 As SAPbouiCOM.Column
    ' Dim oColumn4 As SAPbouiCOM.Column
    oColumn1 = oColumns.Item("col_0")
    oColumn2 = oColumns.Item("col_1")
    oColumn3 = oColumns.Item("col_2")
    ' oColumn3 = oColumns.Item("col_3")
    While Not ds.EoF
    oMatrix.FlushToDataSource()
    oForm.DataSources.UserDataSources.Item("dsItemcode").Value = ds.Fields.Item("Code").Value
    oColumn1.DataBind.SetBound(True, "", "dsItemcode")
    oForm.DataSources.UserDataSources.Item("dsItemdesc").Value = ds.Fields.Item("Desc1").Value
    oColumn2.DataBind.SetBound(True, "", "dsItemdesc")
    oForm.DataSources.UserDataSources.Item("dsquantity").Value = ds.Fields.Item("Quantity").Value
    oColumn3.DataBind.SetBound(True, "", "dsQuantity")
    oMatrix.AddRow()
    ds.MoveNext()
    End While
    plz help me any suggesions. in that. i want to save that matrix data in to tables. plz help me   urgent asap
    regards,
    nagababu.

    Hi,
    UDOs don't save data from UserDataSources (UDS) (and BTW: your code is wrong: you mustn't bind the UDSs to to columns time after time in the loop; that's just wrong). YOu have to handle such data in your code.
    Regards,
    Frank

  • Fill and sort a Matrix/Grid

    Hi gurus !!
    I want to know if there is a way to fill a Matrix with a sql query or with element of a collection ?
    In fact, i want to fill a "grid" or a "matrix" with data wich came from differents tables with join AND have the possibily to sort my "grid" or "matrix" by clicking on RowHeader....
    Thanks for your answers.
    Laurent.
    Message was edited by: Laurent TESTA

    Hi Laurent,
    Like Louis said; you'll need the Grid object. Multiple tables is not possible with matrix (or you must use a very slow recordset object) You'll find a detailed sample in the SDK sample directory or in the SDK Help: <i>UI-API > Reference > Objects > Grid</i> (Click the link below the page "Adding a Grid item")
    Or, if you are using SBO 2005 SP01, you can create the Grid in the Screen Painter, you'll find a detailed instruction in the SDK Help by the topic <i>Screen Painter > Working with the Screen Painter</i>
    For the sorting; it's not possible 'right out the box', however, you can create it. Capture mouseclicks on the Grid header, and perform a new query on the grid. See the pseudo code below.
    switch(pVal.ColUID)
      case 1:
        sSQL = "SELECT * FROM FOO ORDER BY column1";
        break;
      case 2:
        sSQL = "SELECT * FROM FOO ORDER BY column2";
        break;
    MyDataTable.PerformQuery(sSQL);
    You might want to make it a bit smarter to sort ascending/descending, but that's up to you...
    Hope it helps, good luck,
    Rowdy

  • UDO + Matrix + CFL

    Hi,
    How can put to work together a matrix that links to an UDO that works with two user defined tables (a header and a detail), and a CFL two select values from the item table to put after in the matrix and update the UOD (and the table).
    In Screen Painter I put the references, in the matrix, to the detail user table. By code I put the CFL and all works fine. But when I put the values from the CFL in the row's matrix, seems that the matrix loose the original DataSource instead the DataSource from the CFL.
    Anybody knows how put to work this three objects together.
    Thanks in advance,
    Oscar S.M.

    Hi
    Seems that you have to control the values you are passing from and to the CFL.  You can do this by using the SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST event.  Also, try to evaluate the value of the cell on the lost_focus or validate event.
    Does the value has any special formatting (such as serial number or gl account number)?
    There's a sample on the SDK , C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\17.ChooseFromList that deals with assigning values to a control on the event!
    Hope it helps

  • Matrix with UDO

    Hi,
    I've just created an UDO Matrix. The problem I've got is I can't add data without creating a Botton to insert.
    If realized if I create the same Matrix without UDO all the fields are editable.
    Is there anything I'm doing wrong or is it a limitation for UDO objects???
    Thanks in advance.

    You must use the button, and handle the click event. Here is the code that i´m using:
             oDS.InsertRecord(oDS.Size)
            oDS.Offset = oDS.Size - 1
            oMatrix.AddRow(1, oDS.Size - 1)
    Unfortunelly, I haven´t found any other way yet.  Maybe in the SDK 2005 it is possible to handle events of the right mouse button for the matrix, but you will still need the code.
    Thanks,
    Christiano.

  • Z-A Sorting Matrix Data

    Hi,
    I have a Matrix Report in the following way:
    Itemcode Sale
    001 200
    002 300
    003 100
    004 500
    005 300
    I want to sort the matrix report in Decending Order Z-A on Sales Column.
    Please help me, it is very urgent for me.
    I will be Thankful to you.
    Thanks and regards,
    Syed Muzzammil

    Hi Syed,
    I am assuming that you re calculating the "YearTotal" sales in a summary column inside your report's data model. If that is the case, then reports does not know the values of this column before creating the report. It calculates this value in every row. So it will not be able to sort by this column, because for sorting you need to know all the values beforehand.
    What you can do is - in Reports data model, you introduce a Formula Column inside the same Group as Item_Code. In this Formula Column, use PL/SQL to calculate the value of YearTotal sales (just total sales for one product over all months). Then go to the Property Inspector of this column, and set Break Order > Descending. This should do to trick.
    Make sure that you drag this column in group to be at the top (above Item_Code).
    For more information, see Builder help on "Break Order property".
    Navneet.

  • Sorting in User Matrix

    Hey All,
    If the user clicks on a column header in a user matrix is there a quick way of sorting that data accordingly? I understand that the developer has to do this manually.
    Does anyone have a code example of how to do this?
    I cannot find any in the forums, samples or help files.
    I use this code to populate my matrix:
    oDBDataSource.Query(oConditions);
    this.OMatrix.LoadFromDataSource();
    Thanks.

    Hi Laura,
    You have another message talking about how to sort a matrix:
    Re: Sort data in matrix using DBDataSources
    The only think you have to do is put this code inside the ItemEvent DoubleClick on the first column of your matrix. Then you have to sort your datas depending on the column clicked.
    Regards
    Trinidad.

  • I am Using Two Matrixs in one screen

    Dear All,
    I am working on UDO Concepts,I created one screen same as PurchaseOrder Screen Item type and service type document in this i am taking one matrix for item document and one matrix for service document  every thing is fine but while adding document  I selected Item information (Itemcode and related information) then clicked on ADD button it displaying operation completed successfully. but while using navigation buttons it showing empty information in Item matrix. For Service Document it's working fine what is the reason for this type of cases.
    Please give me the solution  ASAP
    Thanks & Regards
    Naresh

    am using only one Child table for two matrixs.Is there any problem using one child for two matrixs.
    This is your problem.
    Unless you want the matrices to be absolutely identical (including data), you will need to specify an own child table for each of them, and to databind them accordingly. Every UDO matrix should be filled from a child table.
    EDIT: I have just tried putting two matrices on a UDO-based form and they worked well. If one of your matrices isn't pupulated correctly, there must be a problem with binding.
    Edited by: Anton Shepelev on Apr 14, 2009 3:17 PM

  • UDO data adding policy

    Hello Everyone,
    I've noticed that in my UDO matrix only visible & active columns are being saved in the DB, although i do manage and set values in some fields which are not represented on matrix, through the DBDataSource. Is there any way to make it save these fields values also?
    Thanks
    Mosh

    Hello
    Yes. from B1 2007 PL 46 you have DI API Interface for UDO.
    You may try this interface.
    sample code from help
    Dim oGeneralService As SAPbobsCOM.GeneralService
    Dim oGeneralData As SAPbobsCOM.GeneralData
    Dim oChild As SAPbobsCOM.GeneralData
    Dim oChildren As SAPbobsCOM.GeneralDataCollection
    Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
    'Get GeneralService (oCmpSrv is the CompanyService)
    Set oGeneralService = oCmpSrv.GetGeneralService("MainUDO")
    'Create data for new row in main UDO
    Set oGeneralData = oGeneralService.GetDataInterface(gsGeneralData)
    oGeneralData.SetProperty "Code", "First"
    oGeneralData.SetProperty "U_Data", "my data"
    'Create data for a row in the child table
    Set oChildren = oGeneralData.Child("ChildUDO")
    Set oChild = oChildren.Add
    oChild.SetProperty "U_Data", "child data"
    oChild.SetProperty "U_Type", 6
    'Add the new row, including children, to database
    oGeneralService.Add oGeneralData
    Regards,
    J

  • How to save data for Binded Matrix  in Sqlserver200(DB)

    hai all,
    i  created a Form by using Udo form generator.
    in that i bind the matrix with Userdatsources. its successfully binded to the matrix. but when i press "Add" Button the Sqlserver tables are not saved.
    if i enter values manually without binding the udo matrix, all rows are getting saved in sqlserver successfully.
    plz help me how to save the rows in the binded matrix to the tables in Sqlserver.
    Regards,
    Nagababu.

    Since you are using UserDataSources, you have to construct a function that loops through the columns, and by name and or alias you construct the INSERT and/or UPDATE query (assuming the destination table is User Defined).
    Check out this link
    Re: Matrix Processing
    Hope it helps

  • 请教:如何在MATRIX中选择一行

    各位高手,请问如何在UDO对象中,选择一行,就像批次表中那样 ,点击一行的任何地方就可以选中这行,且变为黄色。
    谢谢各位的意见。

    你是指如何通过代码选择窗体上Matrix的行?还是什么想选择UDO里数据?
    如果是前者的话用Matrix.SelectRow
    Public Sub SelectRow( _
       ByVal RowNum As Long, _
       ByVal Select As Boolean, _
       ByVal MultiSelect As Boolean _

  • Matrix.AddRow "eats" rows

    Hello
    I'm trying to do sorting on matrix object. I'm almost there but there is small problem. Here is the code
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    every time I fire double click event (which contains sorting code) my matrix will show less and less items until it becomes blank.
    If it helps somehow I'm posting code which I use for actual sorting.
                if (pVal.ColUID == "col_dost")
                    matrix.Clear();
                    List<Dostawca> dostawcy = new List<Dostawca>();
                    DBDataSource dbDataSource = form.DataSources.DBDataSources.Item("@CT_PRP1");
                    int count = dostawcy.Count;
                    int k = 0;
                    for (int i = 0; i < dbDataSource.Size; i++)
                        string sValue = dbDataSource.GetValue("U_CardName", i);
                        Dostawca dostawca = new Dostawca();
                        dostawca.Nazwa = sValue;
                        dostawca.Idx = k;
                        dostawcy.Add(dostawca);
                        k++;
                    var sortedList = dostawcy.OrderBy(x => x.Nazwa).ToList();
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    and here is my "Dostawca" class
        public class Dostawca
            private string _nazwa;
            private int _id;
            public Dostawca() { }
            public string Nazwa
                get
                    return _nazwa;
                set
                    _nazwa = value;
            public int Idx
                get
                    return _id;
                set
                    _id = value;
    Thanks
    Kamil

    Ok, never mind. I see the problem.

Maybe you are looking for