cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to send a bound action call v4 oDataModel

parul_ng
Member
0 Kudos
871

Hi Experts

I am trying to create an action call to RAP OData v4 service.But getting an error "Not a bound action" .When i pass this context oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn(...)");
When I remove (...), I get an error"Binding must be deferred.Can you tell me where am I going wrong?

Here is the code snippet:

var oModel = this.getOwnerComponent().getModel();var contactsPersonArray = oContactsModel.getProperty("/contacts"); var oModelContext = oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn"); oModelContext.setParameter("ReqID" , "NGBTPADMIN20231207142608"); oModelContext.setParameter("Reqtype", "NEWREG"); oModelContext.setParameter("Isdraft", false); oModelContext.setParameter("_newReg", newreg); oModelContext.setParameter("_contactPersons",contactsPersonArray); oModelContext.execute('$auto',true).then( function () { console.log("success"); }, function (oError) { console.log("error",oError.mesaage); }) ;

View Entire Topic
medhoohsao
Discoverer
0 Kudos

Your first link seems ok oModel.bindContext("/MemRegReq('NGBTPADMIN20231207142608')/com.sap.gateway.srvd_a2x.zsd_mem_regreq.v0001.submitMemRegn(...)"), but there is a concen. Check your metadata, and make sure there is no alias for your service. It could be 'SAP__self' you need to use alias if there is, rather than the service technical name 'alias.action(...)'.