cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot use AssetService due to undefined error

0 Kudos

Hello colleagues,

I'm creating a Portal Site, which tries to load an image that was uploaded in the Asset Management.

When I execute this command:
sap.ushell.Container.getService('AssetService')

I receive the error message in my console:
Uncaught TypeError: Cannot read property 'hasNoAdapter' of undefined
at C.getService (https://sapui5.hana.ondemand.com/1.40.15/resources/sap/fiori/core-min-1.js:69:4579)
at eval (eval at evaluate (:117:21), <anonymous>:1:22)

However, I'm still able to get the services SiteService and CrossApplicationNavigation

I'm trying to execute the steps provided in this exercise url (page 35) and this API link.

Thanks,

Ìgor

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

hi,

Please check the network .through CMD and enter Ping then host name whether it is reachable or not

thanks

Dinesh

0 Kudos

Hi Dinesha,

This makes sense. Today I had to set a different proxy in my computer before testing the Portal application again.

But do you know why only the asset service fails and the other (navigation or SiteService) work fine?

Thanks!
Ígor

0 Kudos

Not sure why, but after I added the code in a try catch the sap.ushell.Container.getService('AssetService') started working without problems althoght I receive a 403.

If execute it without the try catch the code breaks due to the error message described above.

Regards,
Ígor