배치 레코드를 보낼 수 없습니다. 하지만 매번 단일 엔티티를 추가 할 수 있습니다. 제출할 때 다음 함수를 사용했습니다. // 매번 단일 항목을 만듭니다. onSubmitChanges : 함수() {SAPUI5에서 oData를 사용하여 배치를 작성하는 방법은 매번 단일 레코드를 생성 할 수 있습니다.
var oSelectedVal = this.getView().byId("plmSelect"),
oSelectedVal = oSelectedVal.getSelectedItem().getKey(),
oModel = this.getView().getModel(),
oEntry = {};
oEntry.MyKeyField1 = oSelectedVal;
oEntry.MyEntry1 = globalVariable1; // global variable declared to get values
oEntry.MyEntry2 = globalVariable2;
oEntry.MyEntry3 = globalVariable3;
oEntry.MyEntry4 = globalVariable4;
if (oEntry.MyKeyField1 !== "" && oEntry.MyEntry1 !== "" && oEntry.MyEntry2 !== "") {
var oContext = oModel.createEntry('/MyEntitySet', {
properties: oEntry,
success: function() {
MessageToast.show("Create successfuly");
// not able to delete/remove after created successfully used the following
//oModel.setBindingContext(oContext);
//oModel.resetChanges();
//aModel.destroyBindingContext();
/*oModel.updateBindings({
bForceUpdate: true
});*/
// oModel.refresh();
//oModel.deleteCreatedEntry();
},
error: function() {
MessageToast.show("Create failed");
}
});
oModel.submitChanges();
//oModel.refresh();
} else {
MessageToast.show("Store Area and Store Description are madatory.");
}
this.onUpdateFinished();
},
게시하기 전에 코드를 정리하십시오. –
질문에 대한 답변이 정말 없습니다. 배치로 무엇을 보내시겠습니까? 지금은 효과가없는 것은 무엇입니까? – luuksen