Release Bulletin 2.3 SP09

Create Operation

The createCreate operation allows the client to create a new record in the local database. To execute a create operation on an MBO, create a new MBO instance, and set the MBO attributes, then call the save()Save() or create()Create() operation. To propagate the changes to the server, call submitPendingSubmitPending.

Customer cust = new Customer();
cust.setFname ( "supAdmin" );
cust.setCompany_name( "SAP" );
cust.setPhone( "777-8888" );
cust.create();// or cust.save();
cust.submitPending();
SMP101DB.synchronize(); 
// or SMP101DB.synchronize (String synchronizationGroup)
Customer cust = new Customer();
cust.Fname  =  "supAdmin" ;
cust.Company_name =   "SAP";
cust.Phone = "777-8888";
cust.Create();// or cust.Save();
cust.SubmitPending();
(void)create

Example 1: Supports create operations on parent entities. The sequence of calls is:

SMP101Customer *newcustomer = [[SMP101Customer alloc] init];
newcustomer.fname = @”John”;
...  //Set the required fields for the customer
[newcustomer create];
[newcustomer submitPending];
[SMP101SMP101DB synchronize];

Example 2: Supports create operations on child entities.

SMP101Sales_Order *order = [[SMP101Sales_Order alloc] init];
[order autorelease];
//Set the other required fields for the order
order.region = @"Eastern";
order.xxx = yyy;

SMP101Customer *customer = [SMP101Customer find:1008];
[order setCustomer:customer];
[order create];
[order.customer refresh]; //refresh the parent
[order.customer submitPending];  //call submitPending on the parent.
[SMP101SMP101DB synchronize];