Skip to Content
0

Cannot use AssetService due to undefined error

Dec 27, 2016 at 05:35 PM

47

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Dinesha R Dec 28, 2016 at 01:04 PM
1

hi,

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

thanks

Dinesh

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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
Igor Lauxen
Dec 28, 2016 at 01:01 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded