This topic contains 4 replies, has 0 voices, and was last updated by qpongrass 6 years, 7 months ago.

  • Author
    Posts
  • #21304 Score: 0

    qpongrass
    • Contributions: 0
    • Level 1

    I am calling this function (in a client script) from an external suitelet.

    var a = {"User-Agent-x": "SuiteScript-Call"};

    var url = ''

    nlapiRequestURL(url, null, a, handleResponse);

    No matter what I do with the function, it returns the exact same error:

    Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load

    Same setup works just fine when using an internal Suitelet/client combo. What gives???
    This is a cached copy. Click here to see the original post.

  • #21305 Score: 0

    leacelosacolumna
    • Contributions: 0
    • Level 1

    Hi qpongrass, external suitelets' URL are different from that of internal suitelet. (e.g. 'forms.netsuite.com' as opposed to 'system.<dc>.netsuite.com'). Double check how you're processing the URL and adjust your code accordingly.

    You may utilize the nlapiResolveUrl API that returns the appropriate external URL. Just set the 'displayMode' parameter to true.

    https://system.netsuite.com/app/help…ehead_N3059898

  • #21306 Score: 0

    qpongrass
    • Contributions: 0
    • Level 1

    I attached a pic of the code. I tried adjusting the code and using nlapiResolveUrl but both ways resulted in same error:

    Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://forms.na2.netsuite.com/app/com

  • #21307 Score: 0

    pcutler
    • Contributions: 0
    • Level 1

    I see that you're attempting to access content on forms.na2.netsuite.com, what domain is the user trying to access that from? Make sure you're not crossing subdomains and violating a same origin policy. You can try accessing the same suitelet on a different domain or setting the Access-Control-Allow-Origin header if NetSuite allows it.

  • #21308 Score: 0

    qpongrass
    • Contributions: 0
    • Level 1

    I worked with NetSuite support and they concluded that it will work after the next update to NS 18.1.

You must be logged in to reply to this topic.