Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- .NET Development
- :
- Re: VB Update statement not working
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
VB Update statement not working
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-17-2012 01:27 PM
Hi!
Im currently tring to update a field from VB.NET to Salesforce but for some reason the code executes without problems but I do not see any changes on my salesforce instance: Heres my code :
Private Sub queryOpplnItem()
Dim a_opplnitem(0) As netxarEE.sObject
'Sql(Connection & Statements)
Try
con.ConnectionString = constr
con.Open()
Catch ex As Exception
MsgBox("Error while establishing connection..." & ex.Message, "Insert Records")
Finally
End Try
'get a list of oppLineItems
Dim qr As QueryResult = Nothing
qr = binding.query("Select Id,ITEMNMBR__c, Product_Description__c, ITEMCLASSCODE__c, CreatedDate From OpportunityLineItem WHERE oppcurrStage__c = " & "'Closed Won'")
MsgBox(qr.records.Length)
login()
For i As Integer = 0 To qr.records.Length - 1
Dim oppLnItm As OpportunityLineItem = qr.records(i)
Dim itemQuery As String
itemQuery = "INSERT INTO ITEMQTBL VALUES ('"
itemQuery = itemQuery & oppLnItm.Id & "'" & ","
itemQuery = itemQuery & "'" & oppLnItm.ITEMNMBR__c & "'" & ","
itemQuery = itemQuery & "'" & oppLnItm.ITEMCLASSCODE__c & "'" & ","
itemQuery = itemQuery & "'" & oppLnItm.CreatedDate & "'" & ","
itemQuery = itemQuery & "'" & "0" & "'" & ")"
cmd = New SqlCommand(itemQuery, con)
cmd.ExecuteNonQuery()
MsgBox(oppLnItm.Product_Description__c & oppLnItm.CreatedDate)
ReDim a_opplnitem(i)
oppLnItm.Id = qr.records(i).Id
oppLnItm.Transfer2GP__c = True
a_opplnitem(i) = oppLnItm
Next
binding.update(a_opplnitem)
con.Close()
End Sub
0
Re: VB Update statement not working
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-17-2012 01:36 PM
Must specify -----> the specify oli.Transfer2GP__cSpecified = True

