cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor

Hi Orlando,

That is the behavior stated in the documentation

Remarks

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

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

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