cancel
Showing results for 
Search instead for 
Did you mean: 

combo in matrix

Former Member
0 Kudos

Hi,

When I try to list the combo in matrix, it is throwing error as follows.

"Thread was being stopped"

I use the following coding instead of using SBO business objects,

Declaration

Private colstcode As SAPbouiCOM.Column

Calling the function

AddshiftToCombo(colstcode)

Private Sub AddshiftToCombo(ByVal oColumn As SAPbouiCOM.Column)

Dim RS As SAPbobsCOM.Recordset

Dim Bob As SAPbobsCOM.SBObob

Try

RS = Ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RS.DoQuery("SELECT Code, U_Sdescr FROM [dbo].[@PSSIT_OSFT1]")

RS.MoveFirst()

While RS.EoF = False

oCombo.ValidValues.Add(RS.Fields.Item("Code").Value, RS.Fields.Item("U_Sdescr").Value)

RS.MoveNext()

End While

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End Sub

I used, user defined table.

Let me the solution please to overcome this problem.

Thanks a lot in advance.

Venkatesan G.

Accepted Solutions (1)

Accepted Solutions (1)

AdKerremans
Active Contributor
0 Kudos

Hi Venkatesan,

Your piece of code itself is correct.

The thread message must come from somewhere around your call.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

Thanks a lot for your immediate reply.

I have checked and it seems correct.

The error is coming when the cursor comes to the following line

RS.DoQuery("SELECT WhsCode, WhsName FROM OWHS T0 ORDER BY WhsCode").

I have replaced the set of lines with following piece of codes and it is working fine

by using business object and item master. But I am trying to get the list from user defined table and object.

Dim RS As SAPbobsCOM.Recordset

Dim Bob As SAPbobsCOM.SBObob

RS = Ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

Bob = Ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)

RS = Bob.GetItemList

RS.MoveFirst()

While RS.EoF = False

oColumn.ValidValues.Add(RS.Fields.Item("ItemCode").Value, RS.Fields.Item("ItemName").Value)

RS.MoveNext()

End While

Thanks & Regards,

Venkatesan G.

Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Venkatesan -

in order to understand what exactly your code is doing you need to profile its

execution. You should use B1 .NET Profiler, part of B1DE available for download

here on SDN under the section Business One SDK Tools.

With no need to instrument or rebuild your code, B1 .NET Profiler will log on a

window all the calls done by your addon to the SDK functions. It displays also the

thread id where the call happened, so you can understand which of your threads

is causing an issue.

Answers (0)