cancel
Showing results for 
Search instead for 
Did you mean: 

Data does not save on MDR job

former_member190818
Active Contributor
0 Kudos

Hello,

When I run MDR job and if there is any error in one of the record, the other record values are not getting saved. Can you please help me how can I overcome this issue? I'm using query.Execute() method and updating the record values in the loop. Should I need to use ExecuteFromDB()?

Thanks.

Regards,

Mohan Babu

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member186648
Active Contributor
0 Kudos

Hi Mohan,

You could search in the Repository explorer under Inbound service interfaces, if not found you could create one.

Thanks, Pradeep.

former_member186648
Active Contributor
0 Kudos

Hi Mohan Babu,

In the loop when you modify, the changes are not yet saved, all the changes are saved at once, hence if there is any error everything gets rolled back.

If you want to save for earch iteration in the loop, then you could execute webservice in the loop.

Thanks, Pradeep.

former_member190818
Active Contributor
0 Kudos

Hello Pradeep,

Do I need to create custom web service or is there any standard web service that I can use?

Thanks.

Regards,

Mohan Babu

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Mohan Babu,

Why do you call a query manually in a MDRO? This makes the complete process nonsense. 😞 😞 😞

A MDRO is defined UPON a query and for every query result the resp. action is called.
There is no need for calling a query or an action manually. If you do so, you will lose all advatanges of the MDRO framework, like parallelism,...

Bye,
Horst

PS: I need to write a blog on that. 😉

former_member190818
Active Contributor
0 Kudos

Hello Pradeep / Horst,

Thank you for your responses. My scenario is that I need to update Service Request ticket fields based on some logic. So I would like to get the ticket information. I'm getting all the tickets by querying the standard object and looping over to update the extension fields.

Regards,

Mohan Babu

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Mohan,

Is there a chance for you to have a shadow BO for every ServiceRequest instance?
Because you can enhance the ServiceRequest BO with an action (running on C4C), but you can not define a MDRO on it.
This shadow object needs to carry the query and the action for the MDRO.

HTH,
Horst

former_member190818
Active Contributor
0 Kudos

Hello Horst,

I'm actually having a custom BO for all the tickets and then querying the data in action and updating the tickets.

Regards,

Mohan Babu

former_member186648
Active Contributor
0 Kudos

Hi Mohan,

MDRO executes the action and then save, which means if there is any error in the action execution, none of them would be saved.
To solve your issue, either fix the errorneous record or enhance your query parameter to filter out such errorneous record.

Thanks, Pradeep.