on 05-09-2013 1:24 PM
Hi,
We are developing an Android Native Application using SUP 2.1.3.
We mapped some operations to a MBO and in a specific moment we need to call one operation after other. The source code below is a sample:
Pedido mbo = salesOrder.getMbo();
mbo.setItemPedidos(getMboSalesOrderItems(salesOrder.getItems()));
//We must ensure that the record is created or update in the backend
mbo.save();
OTMobileDB.synchronize();
//We call the second operation to do some processing in the backend
mbo.finalizarPedido();
mbo.submitPending();
OTMobileDB.synchronize();
The second operation has the type update.
The problem is that the second operation is not invoked. We made multiple tests and the invocation never reaches the backend.
How can we invoke multiple operations at the same MBO? How can we ensure that the second operaion will be called?
Hi David,
It is possible to call/execute one operation after another.
You simply check the code below;
MBOName object = MBOName .findByPrimaryKey(your_primary_key_inputs);
object .FirstOperation(some_parameters_if_any);
object .submitPending();
object .SecondOperation(some_parameters_if_any);
object .submitPending();
AppNameDB.synchronize("sync_group_if_any");
Also, one thing to note in your code is that the second operation is an UPDATE operation. So it has to update a record in the back end system.
Therefore, you need to create an object of the MBO having instance of the record to be updated and perform operation on that object.
Example: EmployeeMBO object = EmployeeMBO .findByPrimaryKey(Employee_Id);
Hope this helps... 🙂
Regards,
Dharmaraj Patil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David.
have you test with update operation only? Maybe you could use SubmitPendingOperations instead of single SubmitPending method .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.