You need to sign in to do that
Don't have an account?
Rolando Esteves
VB Update statement not working
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
Must specify -----> the specify oli.Transfer2GP__cSpecified = True