0

SELECT Name, ProfileId, Id, Username FROM User this is the select query to retrive data in Force.com explorer

Now I wan't to update a column how can I do this? update key word it self not working here please give the solution for this. thanks in advance

Balu
  • 43
  • 2
  • 9
  • I am trying to update from WinForm Application using following query Update Profile set Name='Standard User' where Id='00e90000001XQiYAAW' Now I am getting following error ERROR:MALFORMED_QUERY: unexpected token: Update – Balu Apr 24 '14 at 04:08

2 Answers2

0

In Salesforce you not write to update query same as in SQL.

Please use update method to update column of an object.

More information and sample please read following documents.

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_update.htm

0

I found Solution it's working fine now, If any one haveing doubts ask me for Create,Update,Get functionalities

private void UpdateProfileId(string Id)
{
 SforceService sfs = new SforceService();
 var login = sfs.login(ConfigurationManager.AppSettings["username"],ConfigurationManager.AppSettings["password"]);

 sfs.Url = login.serverUrl;
 sfs.SessionHeaderValue = new SessionHeader();
 sfs.SessionHeaderValue.sessionId = login.sessionId;
 var userinfo = login.userInfo;

 QueryResult qr = null;
 sfs.QueryOptionsValue = new salesforce.QueryOptions();

 User[] UpdateUser = new User[1];
 User objuser = new User();
 objuser.Id = Id;
 objuser.ProfileId = "00e90000001CcTnAAK";
 UpdateUser[0] = objuser;

 try
 {
   SaveResult[] saveResults = sfs.update(UpdateUser);
   foreach (SaveResult saveResult in saveResults)
   {
    if (saveResult.success)
     {
       Console.WriteLine("Successfully updated Account ID: " +saveResult.id);
     }
   }
 }
}
Balu
  • 43
  • 2
  • 9