cancel
Showing results for 
Search instead for 
Did you mean: 

DBDataSource binding and matrix

Former Member
0 Kudos

Hello SBO programmers

It is the idea to fill up the field(s) of the business partner menu identified by debug info as follows:

Send to [Form=134 Item=178 Column=1 Row=1 Variable=14 CRD1,Address]

(Column=45,44,2 and so on ...)

As far as I know is, that an item of class matrix

has to be accessed with using datasources.

Now I have the idea, that the table CRD1 is

such a datasource.

{

Dim oForm As SAPbouiCOM.Form

Dim oDBDataSource As SAPbouiCOM.DBDataSource

Dim sNewValue, sActualValue As String

Dim i As Integer

oForm = SboAppl.Forms.GetFormByTypeAndCount(134, FormTypeCount)

oDBDataSource = oForm.DataSources.DBDataSources.Item("CRD1")

i = oDBDataSource.Size

i = i - 1

' with this statement the value "Send to " results

sActualValue = oDBDataSource.GetValue("Address", i)

' -> sActualValue == "Send to "

sNewValue = "Send to another address"

' <i>but this following statement is not executed, the program runs out</i>

oDBDataSource.SetValue("Address", i, sNewValue)

}

WHY is the address not overwritable ?

Is it the right way or must be choosed another way ?

Thank You very much for feedback.

Best regards

Guido Baumeler

IVM Engineering AG

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Guido,

The CRD1 is the system datasouce of the system form. So you can't operate with it as you wish. There are some restrictions for working with datasources of the system forms.

Regards,

Mark

Former Member
0 Kudos

Hi Guido,

In order to add addresses to the Business Partners, use the BusinessPartner.BPAddresses.Add method.

From the DI API help:

Description

BPAddresses is a business object that represents the addresses list of a specific business partner. This object is part of the Business Partner module of the SAP Business One application.

You can retrieve or set this object by using the Addresses property of the BusinessPartners object.

This object enables you to add the address details of a business partner.

Source table: CRD1.

Hope helps,

Ibai Peñ

Former Member
0 Kudos

Hi there,

Why don't you use recordset.doquery to search for your record and use recordset.update to do an update?