Skip to Content
author's profile photo Former Member
Former Member

UI - LinkedButton - MatrixCell

Hi there,

We want to use a LinkedButton within a Matrix Cell,

but can't find any CodeSample in UI Help.

Where can i get a Code Sample for adding a LinkedButton

to a Matrix Cell.

Thanks Thomas

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Dec 01, 2004 at 03:51 PM

    Here you have a sample showing how to create a column with a linked button inside:

    Dim oColumn As SAPbouiCOM.Column

    Dim oLink As SAPbouiCOM.LinkedButton

    '// Add a column of type LinkedButton (the text and the linked button will be in the same column)

    oColumn = oColumns.Add("BPCardCode", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)

    oColumn.TitleObject.Caption = "Card Code"

    oColumn.Width = 40

    oColumn.Editable = True

    '// Link the column to the BP master data type

    oLink = oColumn.ExtendedObject

    oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner

    '// Bind the column to a datasource containing the key of the object you link to

    '// not mandatory, you can enter the information using UserDataSources or simply by the user

    oColumn.DataBind.SetBound(True, "OCRD", "CardCode")

    Hope it helps


    PS: Please assign points to the answer if it is satisfactory for you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2004 at 05:22 PM

    I just want to specify that this feature is only available since SBO 2004 (6.7)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2004 at 10:00 PM

    If you're using SAP 6.5, this will help you with implementing it. I've copied this from a previous post.

    I've done this many times with Business One 6.5. It is not officially supported by the SDK, but it can certainly be done with some creativity.

    The trick is to catch the et_MATRIX_LINK_PRESSED event that is raised when the link button is clicked, and manually handle the displaying of the target data.

    Here's some code that will get you well on your way to implementing the link buttons.

    This block adds a column for each field on a UDT. One of the fields is added as a link button.

    Set UDT = GetUserDefinedTable(SITE_TABLE_NAME, Company)

    If Not UDT Is Nothing Then

    If UDT.UserFields.Fields.Count > 0 Then

    For Index = 0 To UDT.UserFields.Fields.Count - 1

    'Debug.Print UDT.UserFields.Fields.Item(Index).Name

    If UDT.UserFields.Fields.Item(Index).Name = "U_SiteNum" Then

    Set Column = Columns.Add(UDT.UserFields.Fields.Item(Index).Name, it_LINKED_BUTTON)


    Set Column = Columns.Add(UDT.UserFields.Fields.Item(Index).Name, it_EDIT)

    End If

    With Column

    .TitleObject.Caption = UDT.UserFields.Fields.Item(Index).Description

    .Width = 100

    .Editable = False

    ' Field is invisible if it is in the excludes list

    .Visible = Not FieldsToExclude.Exists(Trim(UCase(UDT.UserFields.Fields.Item(Index).Name)))

    Call .DataBind.SetBound(True, "@" & SITE_TABLE_NAME, UDT.UserFields.Fields.Item(Index).Name)

    End With

    Next Index

    End If


    Call Application.MessageBox("Unable to get handle to " & SITE_TABLE_NAME)

    End If

    This code here is what happens when the link button event is caught.


    If pVal.Before_Action = False Then

    If pVal.ItemUID = SITE_MATRIX_UID Then

    Call GotoLinkClickedInMatrix(FormUID, SITE_MATRIX_UID, "U_SiteNum", pVal.Row, SITE_FORM_NUMBER + SAP_CUSTOM_FORM_ADD_FACTOR, SITE_MENU_UID, "U_SiteNum", "1", Application, "U_BPCode")

    End If

    End If

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.