on 07-02-2007 10:59 AM
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.
Hi Venkatesan,
Your piece of code itself is correct.
The thread message must come from somewhere around your call.
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.