Hi,
I am trying to call the function import in the UI5 application.
Below is the metadata of the function import.
<EntityContainer Name="ZOD_EMPLOYEE_SRV" m:IsDefaultEntityContainer="true">
<EntitySet Name="ET_EmployeeSet" EntityType="ZOD_EMPLOYEE_SRV.ET_Employee" sap:pageable="false" sap:content-version="1"/><FunctionImport Name="createEmpId" ReturnType="ZOD_EMPLOYEE_SRV.ET_Employee" EntitySet="ET_EmployeeSet" m:HttpMethod="GET"/>
</EntityContainer>
I have tried to access the function import by direct URL and it works as expected.
<domain>/sap/opu/odata/sap/ZOD_EMPLOYEE_SRV/createEmpId
But in the ui5 application, I am trying to access it. It does not trigger the call. I am not able to see any odata call
at 'network' tab.
debugger;
var oUrlParams = {};
oDataModel.callFunction("/createEmpId", {
method: "GET",
urlParameters: oUrlParams,
success: fnS,
error: fnE });
function fnS(data,response){
debugger;
console.log(response);
}
function fnE(oError){
alert("Error in read"+oError.message);
}
please help here to resolve this issue.
Thanks & Regards,
Vignesh
Hi,
I used the callFunction statement as below and it started working as expected.
oDataModel.callFunction("createEmpId", "GET", null, null, fnS, fnE);
function fnS(data, response){
debugger;
}
function fnE(oError){
alert("Error in read"+oError.message);
}
Thanks,
Vignesh
oDataModel.callFunction("createEmpId", {
try without the /.
Add a comment