Skip to Content
0

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

Feb 22, 2017 at 03:49 AM

87

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Pedro Magueija Feb 22, 2017 at 05:57 AM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0
Pedro Magueija Feb 27, 2017 at 07:03 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded