Pergunta

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

Foi útil?

Solução

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

Outras dicas

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);
     }
   }
 }
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top