cancel
Showing results for 
Search instead for 
Did you mean: 

Using DataSources for UserFields in System Table RDR1...

Former Member
0 Kudos

Hello experts...

I just need a little intro, in how to assign values to my User-Fields in RDR1 Orders... through UI.API, so can be displayed in the same Lines-Matrix.

I'm catching Validating Event in Line-Matrix when I get the ItemCode, then I need to perform some task, and finally assign results to this user-fields, that I have in the same line.

Initially I do it like this:


   EditText = Column.Cell.Item(row).Specific
   EditText.Value = Result

When I do this, B1 throws again and again the "Validating" event for column 1 (ItemCode)... and so, the program has infinity loop throwing the same event for the same item...

I'm reading about assigning values to DataSources directly in SDK, but there's not enough info for this example... "System table + UserFields"...

I'm new in DataSources area... so I need a little more infor to perform this task, and to understand DataSources in B1.

Thanks.

gab

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Try This

Dim oMatrix As SAPbouiCOM.matrix
For I = 1 To oMatrix.VisualRowCount

oMatrix = oForm.Colums.Items("UrColumnId").Cells.Item(I).Specific.Value = "Assign ur value here"  

I = Row Id

Next

former_member201110
Active Contributor
0 Kudos

Hi Gabriel,

It isn't possible to write to a UDF that is on a system form by using the datasource. This is by design as it prevents an addon from bypassing the standard logic in SBO.

To stop the infinite loop, just check the InnerEvent property during the validate event of the item code field and only run your code to update the UDF value if InnerEvent is false.

Your code to update the field on the UDF is fine but from patch 9 of SBO 2007A onwards, there is a new method called GetCellSpecific which is much faster than using the Column object to retrieve the cell object


EditText = sboMatrix.GetCellSpecific("MyColUID", i)
EditText.Value = Result

Kind Regards,

Owen

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Gabriel,

Have a look at the sample code for matrix and DataSource at ...

...\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\06.MatrixAndDataSources

Eddy