Skip to Content

Two different linked buttons in a single column.

Hi,

I have a grid with 1 column of link buttons.

My first attempt uses only one SAP B1 table (OPDN) as datatable, and I created the linked button using the following code:

        ''==============================================

        ''// LINKED BUTTON

        ''==============================================

        Dim oCol As SAPbouiCOM.EditTextColumn

        oCol = oGrid.Columns.Item("DocNum")

        oCol.LinkedObjectType = "20"

With this model, the linked button works fine. Clicking on it opens the appropriate GRPO document.

----------

My next attempt is to use 2 SAP B1 table (OPDN and ORPD i.e Goods Receipt PO and Goods Return)

I used UNION ALL in the query to group the 2 tables.

If "TYPE" = 'GReturn', then the linked button should refer to ORPD ( oCol.LinkedObjectType = "21")

If "TYPE" = 'GRPO', then the linked button should refer to OPDN ( oCol.LinkedObjectType = "20")

Can this be done? How to modify the basic code?

I can achieve my objective with 2 columns of linked buttons, one for  oCol.LinkedObjectType = "21", and the other for  oCol.LinkedObjectType = "20".

But I would like to put both types of linked buttons in a single column, and use a 'Type' column to distinguish the LinkedObjectType.

Thanks

Leon Lai

Capture.JPG (115.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 23, 2014 at 12:28 PM

    Hi,

    This can be achieved.

    we can achive by coding i.e. when u click on the link button u need to open the GRPO/GRREturn document based on the type

    When u need to open the document in find mode and sent the document no.

    Regards,

    Prasad

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 24, 2014 at 04:29 AM

    Hi Leon,

    I am using it as follows and that is working perfectly for me.

    Use it on BeforeAction == true

    case BoEventTypes.et_MATRIX_LINK_PRESSED:

                                    {

                                        if (pVal.ItemUID == "Grid" && pVal.ColUID == "DocEntry")

                                        {

                                            SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)m_SBO_Form.Items.Item("Grid").Specific;

                                            int Row = pVal.Row;

                                            string DocumentDescription = Convert.ToString(oGrid.DataTable.GetValue("Document Description", Row));

                                            if (DocumentDescription == "Journal Entry")

                                            {

                                                SAPbouiCOM.EditTextColumn oEditColumn;

                                                oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("DocEntry")));

                                                oEditColumn.LinkedObjectType = "30";

                                            }

                                            else if (DocumentDescription == "Outgoing Payment")

                                            {

                                                SAPbouiCOM.EditTextColumn oEditColumn;

                                                oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("DocEntry")));

                                                oEditColumn.LinkedObjectType = "46";

                                            }

                                            else if (DocumentDescription == "A/P Invoice")

                                            {

                                                SAPbouiCOM.EditTextColumn oEditColumn;

                                                oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("DocEntry")));

                                                oEditColumn.LinkedObjectType = "18";

                                            }

                                        }

                                    } break;

    Although I have used it for Grid, you can use it for matrix.

    Hope it helps.

    Thanks & Regards

    Ankit Chauhan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2014 at 12:24 PM

    hi.

    i don't have any Idea but i would suggest one thing..

    At the time of pressing the linked button.

    you can open the document...

    If objecttype = 13 Then 'objecttype should be the column value which holds the object

                        B1Connections.theAppl.OpenForm(BoFormObjectEnum.fo_Invoice)

                    Else

                        B1Connections.theAppl.OpenForm(BoFormObjectEnum.fo_PurchaseInvoice)

                    End If

    ---

    sbo_application-activemenuitem...

    Add comment
    10|10000 characters needed characters exceeded