• Jap Hendy Wijaya
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi All, 

So i've been learning LWC, and got to the topic of using 3rd party library. i'm curious as to how do we know what function name to use in the 3rd library.

For example, i'm using axios to fetch data from external server
link: https://github.com/axios/axios
I'm configuring the js file of lwc, loadScript to point to '/axios-master/dist/axios.js'

I can call the function, namely axios({ url: ...}).then().catch()
But when i inspect the file axios.js inside folder dist, nowhere i can find the function with name axios, there is function with name Axios though (capitalized first letter). The curious thing is, if i call function Axios, it doesn't work in lwc.

Can somebody help to explain this to me, as i'm very curious how to know the function name to use.

Thank you very much friends.
Hi All, 

So i've been learning LWC, and got to the topic of using 3rd party library. i'm curious as to how do we know what function name to use in the 3rd library.

For example, i'm using axios to fetch data from external server
link: https://github.com/axios/axios
I'm configuring the js file of lwc, loadScript to point to '/axios-master/dist/axios.js'

I can call the function, namely axios({ url: ...}).then().catch()
But when i inspect the file axios.js inside folder dist, nowhere i can find the function with name axios, there is function with name Axios though (capitalized first letter). The curious thing is, if i call function Axios, it doesn't work in lwc.

Can somebody help to explain this to me, as i'm very curious how to know the function name to use.

Thank you very much friends.
Hi All,

Is there a way around the error 'DML not supported for Folder' in a testMethod? This is being a real problem for me because it's preventing me from getting the 75% coverage I need for this class.

One thing I tried is using test code that tries to find one existing Folder object and using that. Like this:

        Folder[] folder = [SELECT Id FROM Folder LIMIT 1];

This works in development, but when I install the package that this code belongs to, I get this error mesage, and the install fails:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: FolderId (invalid folder): [FolderId]

Any help would be appreciated.

 

Andrew