Breaking News
Home / iOS / iOS Snippets / How to update contact in Saleforce via API?

How to update contact in Saleforce via API?

Answer

Using the ZKS Toolkit for Salesforce its easy the update the contact with the following code snippet.

theRecordId – Primary key for the Cotnact Record

ZKSObject *contact = [ZKSObject withTypeAndId:@”Contact” sfId:@theRecordId];
 [contact setFieldValue:@”John” field:@”LastName”];
 [contact setFieldValue:@”Smith” field:@”FirstName”];

 NSArray *results = [sforce update:[NSArray arrayWithObject:contact]];
 ZKSaveResult *sr = [results objectAtIndex:0];

 if ([sr success])
    NSLog(@”updated contact id %@”, [sr id]);
 else     NSLog(@”error updating contact %@ %@”, [sr statusCode], [sr message]);

[pb_builder]

Check Also

EKCalendar – That account does not allow calendars to be added or removed

Usecase When I am trying to create a new Calendar programmatically using the EventKit API …

Advertisment ad adsense adlogger