I am new to SalesForce and the iOS API, but not new to IOS. Does anyone know how I can create a new Event in SalesForce using the iOS API?

  • 1
    What have you tried so far? On SFSE it's best practice to show exactly where you're stuck. Creating objects from the iOS SDK is pretty straight forward as shown in the docs, check out the requestForCreateWithObjectType: method. – Matt Lacey Sep 24 '14 at 7:42
  • Thanks, I finally found those methods. I was just so new to it I was getting overwhelmed with all of the methods that I might need to use. – Nic Hubbard Sep 25 '14 at 16:16

I contributed some nifty block methods to the SDK that make this very easy. See this method:

- (SFRestRequest *) performCreateWithObjectType:(NSString *)objectType 
                                         fields:(NSDictionary *)fields 

And how you might use it:

[[SFRestAPI sharedInstance] performCreateWithObjectType:@"Event" 
                                                 fields:@{ @"SomeField" : @"Some Value" }
                                              failBlock:^(NSError *err) { NSLog(@"Failed with %@", err); }
                                          completeBlock:^(NSDictionary *dict) { NSLog(@"Success with %@", dict); }];
| improve this answer | |
  • I worked on a new iOS project recently and was excited to see the block methods, way easier to deal with! – Matt Lacey Sep 24 '14 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.