Skip to Content
0
Feb 08 at 11:17 PM

Accessing OData values in controller extension "Failed to drill-down into" "Iinvalid segment:"

221 Views

Hello,

I am currently attempting to access data from an oData V4 service. The oData service is from a Service Binding connected to a Fiori elements app. In a controller extension, I have the following code which shows the various ways I have attempted to retrieve a list through first following an association to parent called "_email_temp" followed by an association to the actual list "_attributes":

var oContextBinding = this.getBindingContext();
var oModel = this.getModel();
var oList = oModel.bindContext("/_email_temp/_attributes");
oList.requestObject("").then(function (oObject) {
console.log(oObject);
});

oContextBinding.requestObject("_email_temp/_attributes").then(
function (oAttributes) {
console.log(oAttributes);
});
console.log(oContextBinding);

The issue is that this code fails with following the error:

2023-02-08 16:52:58.963000 Failed to drill-down into _email_temp/_attributes, invalid segment: _email_temp
- /sap/opu/odata4/ope/ui_pcc_et/srvd/ope/ui_pcc_email_template/0001/xOPExP_PCC_EMAIL_TEMP(EtUuid=02120fa4-97ee-1eed-a69e-3c2d1a7060fa,IsActiveEntity=true)/_translations(EmailTransUuid=02120fa4-97ee-1eed-a69e-3c2d1a70a0fa,IsActiveEntity=true)?$select=Description,EmailSendTypeDescription,EmailTransUuid,HasActiveEntity,HasDraftEntity,IsActiveEntity,Language,LanguageName,Status,StatusDesc,TemplateName,__EntityControl/Deletable,__EntityControl/Updatable sap.ui.model.odata.v4.lib._Cache

This is strange because the same error appears when simply trying to get the object "_email_temp" while getting a property from "_email_temp" works correctly. Is there any way to get these objects?