cancel
Showing results for 
Search instead for 
Did you mean: 

Linked button and Textbox

Former Member
0 Kudos

Hi Experts,

I'm new to SAP B1 SDK, I would like to ask for a tutorial or "how to" know how to pass a data from UDF where linked button is connected to another UDF like textbox.

like this

As you can see my image here is just only an example. I would like to pass the value of 26 to the textbox (it is located in module number 1) when I clicked the liked button (it is located in module 2).

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor
0 Kudos

Hi John,

Unfortunately you don't say where this 26 is at. From the picture seem like a grid or matrix.

The recommended way is to use the datasource that is bound to the grid/matrix and extract the value from there.

For a grid you would use its linked datatable:

oGrid.DataTable.GetValue("ColumnId", Row);

For a matrix you would use its linked DBDatasource:

oForm.Datasources.DBDatasource.Item("@MyTable").GetValue("ColumnId", Row);

Save the value to some variable. If your target text box is also on a grid matrix use the same technique but with SetValue(...). Note that this will only be possible in UDFs. We are not allowed to write to system datasources.

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Thank you sir, well that number is really on a matrix from the other customize module (Module 2 ) but when I clicked the arrow button, the number doesn't appear on the textbox on the other Customize module (Module 1). I don't know how display it the number but I will try that work around. I try to do this code

Module 2:

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

oColumn.TitleObject.Caption = "Number"

oColumn.Width = 80

oColumn.DataBind.Bind("RESULT", "COL1")

oColumn.Editable = False

Dim oLink As SAPbouiCOM.LinkedButton = oColumn.ExtendedObject

oLink.LinkedObjectType = "Module1"

is this wrong?

pedro_magueija
Active Contributor
0 Kudos

Hi John,

The LinkedObjectType should be an object of B1 (such as "13" for Invoice or "2" for BusinessPartners). But this would only make B1 automatically open the corresponding form with the corresponding record loaded.

To do as you intend you need to catch the click event (with BeforeAction = true) and then do as I mentioned above.

If you need to know how to catch events (and even if you need more info about the linked button) you can check the SDK Help Center document (installed with the SDK) and the samples (you have many samples with event catching and using linked buttons). These are all installed with the B1 SDK.

ps: you don't need to call me Sir


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Than you very much sir for your help.

Answers (0)