Created
December 22, 2011 12:04
-
-
Save palaniraja/1510080 to your computer and use it in GitHub Desktop.
Create new record/ add new obj in Salesforce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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