Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Created December 22, 2011 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palaniraja/1510080 to your computer and use it in GitHub Desktop.
Save palaniraja/1510080 to your computer and use it in GitHub Desktop.
Create new record/ add new obj in Salesforce
ZKSObject *sfobj = [[ZKSObject alloc] initWithType:@"Your_custom_object__c"] ;
[sfobj setType:@"Your_custom_object__c"];
[sfobj setFieldValue:@"Air Conditioning System" field:@"Name"];
[sfobj setFieldValue:@"PAL-008" field:@"Service_code__c"];
[sfobj setFieldValue:@"Spot" field:@"Service_Status__c"];
[sfobj setFieldValue:@"a07M0000000FV5VIAW" field:@"child_of_another_custom_object__c"];
[[FDCServerSwitchboard switchboard] create:[NSArray arrayWithObject:sfobj] target:self selector:@selector(createObjectResult:error:context:) context:nil];
/*
called when SF completed the request
*/
- (void)createObjectResult:(NSArray *)results error:(NSError *)error context:(id)context{
if (results && !error)
{
for (ZKSaveResult *saveResult in results){
NSLog(@"saveResult: %@", saveResult);
}
}
else {
NSLog(@"Error : %@", [error description])//take care of error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment