Skip to Content

Cannot use AssetService due to undefined error

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 28, 2016 at 01:04 PM

    hi,

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

    thanks

    Dinesh

    Add comment
    10|10000 characters needed 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

  • Dec 28, 2016 at 01:01 PM

    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

    Add comment
    10|10000 characters needed characters exceeded