public static void Update (this SalesforceClient self, SObject sobject)
		{
			var updateRequest = new UpdateRequest (sobject);
			var result = self.ProcessAsync (updateRequest);
			if (!result.Wait (TimeSpan.FromSeconds (SalesforceClient.DefaultNetworkTimeout)))
				return; // TODO : Error handling/reporting
		}
		public static async Task UpdateAsync (this SalesforceClient self, SObject sobject)
		{
			var updateRequest = new UpdateRequest (sobject);
			try {
				await self.ProcessAsync (updateRequest).ConfigureAwait (true);
			} catch (AggregateException ex) {
				Debug.WriteLine (ex.Message);
			}
		}
Ejemplo n.º 3
0
		public async void Pass ()
		{
			var account = new SObject { Id = "001i000000Jss8EAAR", ResourceName = "Account" };
			account.Options.Add("Website", "http://hostilehostel.com");
			var request = new UpdateRequest {
//				Resource = new Search { QueryText = "FIND {John}" }
//				Resource = new Query { Statement = "SELECT Id, Name, AccountNumber FROM Account" }
				Resource = account
			};

			var response = await Client.ProcessAsync<UpdateRequest> (request);
			Assert.That (response.StatusCode, Is.EqualTo(HttpStatusCode.NoContent));
//			var result = response.GetResponseText ();
//
//			var results = System.Json.JsonValue.Parse(result)["records"];
//
//			foreach(var r in results)
//			{
//				Debug.WriteLine (r);
//			}
//			Assert.True (true);
		}