This topic contains 2 replies, has 0 voices, and was last updated by Gabukun 7 years, 11 months ago.

  • Author
    Posts
  • #6181 Score: 0

    Gabukun
    • Contributions: 0
    • Level 1

    Hello everyone,

    I wanted to ask on how I can load external websites in a suitelet.

    The only thing I found so far on the web is Zigman’s http://blog.prolecto.com/2012/04/25/…thin-netsuite/.

    Code:
    function drawManualPage(request, response)
    {
    var context = nlapiGetContext();
    var url = context.getSetting(‘SCRIPT’, ‘custscript_suitelet_url’);
    var title = context.getSetting(‘SCRIPT’, ‘custscript_suitelet_title’);
    var content = ‘
    var newForm = nlapiCreateForm(‘drawHTML’);
    var newField = newForm.addField (‘content’, ‘inlinehtml’, title);
    newForm.addField(‘extra’, ‘inlinehtml’, ”)
    newForm.setTitle (title);
    newField.setLayoutType(‘outsidebelow’);
    newField.setDefaultValue (content);
    response.writePage( newForm )
    }
    While said code loads the content in an iframe, though, I would like to create a popup window loading just the external website, without NetSuite menubar or form title.

    Is there a way to simply load an external website in a suitelet?

    Do you always need to leverage on nlapiCreateForm or could you simply source the webpage like in a window.open(“http://www.disney.com”); method?
    This is a cached copy. Click here to see the original post.

  • #6182 Score: 0

    david.smith
    • Contributions: 0
    • Level 1

    Depends on where you’re calling this from. Any JavaScript will work client side. So you’re window.open method will work as would document.location.

    Be aware of security issues. You cannot load an HTTP site into an HTTPS site, cross domain security and all that jazz.

  • #6183 Score: 0

    Gabukun
    • Contributions: 0
    • Level 1

    Thanks for the input, David. I will check on that right away.

You must be logged in to reply to this topic.