Page 1 of 1

Salesforce Update

Posted: Tue 21 Nov 2017 17:56
by bezpal
I have downloaded DotConnect for salesforce Trial version.
Using .NET and C# I can read from the salesforce using this code:

Code: Select all

string sql = "SELECT Name, OtherField  FROM MyCustomObject WHERE Name='theName123'"
...
command.ExecuteReader();
However if I try to update it doesn't do anything:

Code: Select all

string sql = "UPDATE MyCustomObject "+
"SET OtherField = 'boo' "+
"WHERE Name='theName123'";
...
command.ExecuteNonQuery();
There is no exception or anything but OtherField is not updated.
Any idea what may be going wrong here?

Thanks you!

Re: Salesforce Update

Posted: Fri 24 Nov 2017 20:16
by Shalex
We cannot reproduce the issue at the moment.

1. Cache is stored in a local SQLite database. It is located in the user Application Data directory (C:\Users\{user name}\AppData\Roaming) by default and is named by the Salesforce.com or Database.com account name. Try removing these *.db files (they will be recreated on next conn.Open()). Does this help?

2. Download, set up, run Fiddler and specify web requests sent when you updating MyCustomObject. For example, the requests in my case ("update dept set loc='12345' where dname='abcd'") are:

Code: Select all

[...]<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><query xmlns="urn:partner.soap.sforce.com"><queryString>SELECT Id FROM Dept__c WHERE Dname__c = 'abcd'</queryString></query></s:Body></s:Envelope>

Code: Select all

[...]<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><update xmlns="urn:partner.soap.sforce.com"><sObjects><type xmlns="urn:sobject.partner.soap.sforce.com">Dept__c</type><Id xmlns="urn:sobject.partner.soap.sforce.com">a0BA000000r0UihMAE</Id><Loc__c xmlns="">12345</Loc__c></sObjects></update></s:Body></s:Envelope>

Re: Salesforce Update

Posted: Fri 15 Dec 2017 17:21
by bezpal
It started working. I'm not sure what I was doing wrong.
So we bought the license :)

Thank you.