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

Add an additional column to the system screen matrix and bind it to an existing DBDataSource

HI All,

We are trying to add an additional column in the incoming payment screen using the business one studio. The problems we are facing are as below.

1. The form designer doesnt show us the matrix.

2. We added the column via code but when we try to bind it to a DBDatasource, it gives an error "Data Source - Not User Data Source"

Form current = SAPbouiCOM.Framework.Application.SBO_Application.Forms.Item(pVal.FormUID);
            DBDataSource ds = (DBDataSource)current.DataSources.DBDataSources.Add("OINV");
            UserDataSource uds = current.DataSources.UserDataSources.Add("UsrDEntry", SAPbouiCOM.BoDataType.dt_SHORT_TEXT);
            Matrix dgLines = (Matrix)current.Items.Item("20").Specific;
            Column cl = dgLines.Columns.Add("DocEntry", BoFormItemTypes.it_EDIT);
            cl.TitleObject.Caption = "Test";
            cl.Width = 80;
            cl.Editable = true;
            uds.Value = "12";
            cl.DataBind.SetBound(true, "OINV", "DocEntry");

Does anyone have a sample how to do this?

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    Posted on Feb 22, 2017 at 05:57 AM

    Hi Orlando,

    That is the behavior stated in the documentation


    The following restrictions apply to system DBDataSource objects in system forms:

    • You cannot perform a query on the data source or change its offset.
    • You can only attach items to user-defined fields in the data source.

    I guess the reason is that, if they would allow you to bind to system fields it would be possible to change read-only fields (by leaving the bound column as editable).

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks pedro, Do you have any sample code/idea/documentation on how we can achieve this? We need to add an column in the grid, fill in info from related tables.

  • Posted on Feb 27, 2017 at 07:03 AM

    Hi Orlando,

    Well, the documentation says that you can add User-Defined Fields and bind items to those. So I think you can still add your fields and then bind your column with the created field. What you can't do is bind your column with a "system field".

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded