Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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