cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create an active item for a draft of vice versa SAPUI5 BOPF

catalinfeidi
Participant
0 Kudos
428

Hi,

I'm facing a problem when trying to create an entry for the child entity in display mode using SAPUI5/ODATA/BOPF. When pressing on a button, some entries should be created.

My code looks as follows:

var oModel = this.getView().getModel();
var CRUUID = this.getView().getBindingContext().getObject().CRUUID
var sCreationPath = oModel.createKey("/root", { CRUUID = CRUUID, IsActiveEntity = true }) + "/to_child";
var oChange = {}; //for now just empty
oModel.create(sCreationPath, oChange, {
error: function(oError){
     debugger;
}

I receive the following error:

"Cannot create an active item for a draft or vice versa"

Message Class: /BOBF/FRW/COMMON/ Number: 135

After some research it seems that I have to do as follows:
"As a developer, you can set the field "IsActiveEntity" of the child instance to the same value as its parent's value. As an end user, report this issue to your IT support."

This is something that I'm stuck on. How do I set the field IsActiveEntity = true on child?

If I provide in the oChange the field { IsActiveEntity : true } it just gets abort status.

Someone who can assist me? I would really appreciate your assistance.

Thanks!

Accepted Solutions (0)

Answers (0)