on 05-18-2006 11:30 AM
I can display record into the text boxes of form and can also save it through text box but I want to update the displayed records .... how to do that??
Hi Sudeshna Basu
I'm assuming you are not using UDO as it would do it for you. You would have to get the value in the text box, see if there is a difference then update it.
To update your own table would do something like the following
oUpDateTable = oCompany.UserTables.Item("YourTable")
Rs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
For i As Integer = 1 To A.Length - 1
Rs.DoQuery(" Query to check value diff")
If oUpDateTable.GetByKey(Rs.Fields.Item("Code").Value) Then
oUpDateTable.UserFields.Fields.Item ("YourField").Value = "Value"
if oUpDateTable.Update()<>0 Then msgbox("error")
End If
Next i
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudeshna Basu
Not a problem. You must declare the object that accesses your user defined table.
Dim oUpDateTable As SAPbobsCOM.UserTable = Nothing
Then assign your user defined table, dont place the @ sign for your table name
oUpDateTable = oCompany.UserTables.Item("YourTable")
Forget about the loop, lets assume you doing just one value. Forget about RS, that was something i used in my code for something else.You need to get the record by it's key so you can update that row. The key is the code column of your table.
If oUpDateTable.GetByKey(CodeColumnValue) Then
'so if it found that code it would go inside here
'get the column and assign a value
oUpDateTable.UserFields.Fields.Item ("YourField").Value = "Value"
'then update the table, if value is 0
'it is succesfull
if oUpDateTable.Update()<>0 Then msgbox("error")
end if
Hope this helps
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.