cancel
Showing results for 
Search instead for 
Did you mean: 

MBO Operation not called

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

That was my first attempt. The problem is that the second operation is never called on the backend. The first operation is called correctly, and the record is created on the backend. But the second operation is never called.

Thanks for the help.

Former Member
0 Kudos

Hey David, can you try changing the type of your second operation to OTHERS.

Former Member
0 Kudos

Hi,

I can`t change the type to OTHERS because the operation use MBO attributes and updates the information in the backend.

Thanks for the help.

Answers (1)

Answers (1)

DoanManhQuynh
Active Contributor
0 Kudos

Hi David.

have you test with update operation only? Maybe you could use SubmitPendingOperations instead of single SubmitPending method .