Showing results for 
Search instead for 
Did you mean: 

Linked button in a matrix

Former Member
0 Kudos


We are trying to add a linked button to a matrix.

First of all we tried to add it by xml, but we haven't had luck. this is the xml piece of code:

<column AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" editable="0" font_size="12" forecolor="-1" right_just="0" text_style="0" title="Artículo" type="16" uid="art" val_off="" val_on="" visible="1" width="70">
   <databind alias="art" databound="1" table=""></databind>
   <ExtendedObject linkedObject="4"></ExtendedObject>

We have a datasource binded to this item and it works well, but the arrow doesn't appear.

The other option we tryed is to add it by code, but by now we haven't been able to add it in the correct place. We have only been able to show it in the last position of the matrix.

We have tried to assign an existing column to a column created by us and then link the linked button to it, but it doesn't work.

This is the code that adds the column in the last position (it works):

     Dim formPedido As SAPbouiCOM.Form
     Dim docxml As New XmlDocument
     Dim uid As String
     Dim str As String = docxml.InnerXml
     newformuid(uid, Aplicacion)
        docxml.SelectSingleNode("Application/forms/action/form/@uid").Value = uid
     Dim ParametrosCreacion As SAPbouiCOM.FormCreationParams = Aplicacion.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
     ParametrosCreacion.XmlData = docxml.InnerXml
     ParametrosCreacion.FormType = "Pedido"
     ParametrosCreacion.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
     ParametrosCreacion.UniqueID = uid
     formPedido = Aplicacion.Forms.AddEx(ParametrosCreacion)
     Dim matriz As SAPbouiCOM.Matrix
     Dim flecha As SAPbouiCOM.LinkedButton
     matriz = formPedido.Items.Item("lstoferta").Specific
     Dim columna As SAPbouiCOM.Column
     columna = matriz.Columns.Add("flecha", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)
     columna.Width = 50
     columna.Editable = False
     flecha = columna.ExtendedObject
     columna.TitleObject.Caption = "Flecha"
     flecha.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Items
   With Aplicacion.Forms.ActiveForm.DataSources.UserDataSources
     Dim UDSchk As SAPbouiCOM.UserDataSource = .Add("chk", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
     Dim UDSarticulo As SAPbouiCOM.UserDataSource = .Add("art", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20)
     Dim UDSctdPedido As SAPbouiCOM.UserDataSource = .Add("ped", SAPbouiCOM.BoDataType.dt_LONG_NUMBER)
   End With
     matriz = Aplicacion.Forms.ActiveForm.Items.Item("lstoferta").Specific
     matriz.Columns.Item("chk").DataBind.SetBound(True, "", "chk")
     matriz.Columns.Item("art").DataBind.SetBound(True, "", "art")
     matriz.Columns.Item("pedido").DataBind.SetBound(True, "", "pedido")

How can we do it with XML?

Message was edited by: Martin Garmendia

Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

Hi Martin,

What I do when I want to add a linked column for example a Business Partner is this.

1. Create the XML code for the Screen in Screen painter. (note the column name that you want to link)

2. Access the XML using notepad

3. Set the Column type to 116 -> This is the linked button type. The XML snippet for the column looks like this : title="Rented To" type="116" uid="Col7" val_off=""........

4. Link the datasource through code as normal to the column - query the datasource and load it to the matrix.

This should display the linked column objects

Answers (0)