Show TOC

Create OperationsLocate this document in the navigation structure

Create an SODataEntity using the scheduleCreateEntity:collectionPath:delegate:options: method on the SODataStore.

The scheduleCreateEntity takes an SODataEntity and the collectionName as the parameter. An SODataEntity is created locally and then passed along as a parameter. The SODataPropMode can be combined using the binary operator.
  1. Create a local SODataEntity and set values for the properties.
  2. Set the SODataPropMode. Options are All, Keys, Mandatory, Optional.
  3. Call the scheduleCreateEntity method on the SODataStore. Get the response in the proper delegate method.
    id<SODataEntity> entity = [[SODataEntityDefault alloc] initWithType:@"EntityType"];
    NSError* err = nil;
    [ allocatePropertiesOfEntity:entity mode:SODataPropModeAll error:&err];
    id<SODataProperty> prop = [ objectForKey:@"PropertyName"];
    prop.value = @"Value";
    prop = [ objectForKey:@" PropertyName 2"];
    prop.value = @"Value2";
    [ allocateNavigationProperties:entity error:&err];
    self.currentRequestExecution = [ scheduleCreateEntity:entity collectionPath:@"CollectionPath" delegate:self options:nil];