Search code examples
objective-cxcodesup

to insert data using Objective C and SUP 2.1.3. backend


I am working with Xcode using Objective C and SUP 2.1.3 backend. I want to insert some data. For that I have used create command.

[createReq setCUST_ID:instBaseS.CUST_ID];  
    [createReq setCust_Name:custName.text];

    [createReq setIbase_ID:instBaseS.IBASE_ID];
    [createReq setProduct_ID:pdtID.text];
    NSLog(@"ibase id is %@",instBaseS.IBASE_ID);
    [createReq setProblem_Desc:problmDesc.text];
    [createReq setSub_Product_ID:@"MOTOR"]; 
      NSLog(@"installed bases cust id %@",instBaseS.CUST_ID);

    [createReq create];   
   // [FieldServiceCom_igate_Reshma_fieldservice_ALL_v6DB synchronize];

[createReq submitPending];

In the line [createReq create]; we are getting an exception like

2013-01-16 12:59:22.078 Field_Final[1555:15203] *** Terminating app due to uncaught exception 'SUPPersistenceException', reason: '-1230 (ERROR)'
*** First throw call stack:
(0x1384022 0x4422cd6 0x3a427c 0x3ac9ce 0x12e376 0x12e922 0x1518fd 0x151694 0xd7db2 0xdc0d8 0xdbcb0 0xdbd13 0xde35 0xb18e4 0x1385e99 0x176114e 0x17610e6 0x1807ade 0x1807fa7 0x1807266 0x17863c0 0x17865e6 0x176cdc4 0x1760634 0x2aa5ef5 0x1358195 0x12bcff2 0x12bb8da 0x12bad84 0x12bac9b 0x2aa47d8 0x2aa488a 0x175e626 0x235a 0x22a5)
terminate called throwing an exception(lldb) 

Why are we getting this exception?
Do we want to synchronize DB after the 'create' command?
If the steps above are wrong, what are correct steps to active this?.


Solution

  • The problem got solved.What I did is ,I set all the personalisation parameters and used the 'save' command to save it.Then I synchronized the DB using 'synchronize' command. Then it got inserted into the database.I confirmed it by using a find_by_primary_key method which was in the generated code which the MBO developers used.