Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Marty Zigman LinkedIn

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc.. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM, and eCommerce business systems. Contact Marty to set up a conversation.

BiographyYouTubeLinkedInX (Twitter)

24 thoughts on “How To: Code Pattern for NetSuite Driven JSONP Cross Domain JavaScript

  1. The only problem I have with JSONP and the use of Suitelets is the fact that your Suitelet has to be available anonymously. If they allowed for RESTlets to be used cross domain that would open up a whole array of uses.

  2. Negative. CORS is not allowed.

    Access-Control-Allow-Origin: none

    I believe. I have brought it up in the last two roadmap sessions to Elham at SuiteWorld.

    I was pursuing AJAX calls from mobile apps for a while, where having your credentials in the code woutldn’t be a problem as it was all compiled into native using Phonegap build.

    That was just for yucks, though. I was really wanting to use them from either Portlets or Suitelets. Since forms. system. and rest. are different domains, you can’t. You can get away with using JSONP and a Suitelet as a work around. And it works great, I just don’t like the idea of security through obscurity.

  3. I would love to be able to explore more with the SSP stuff. It kind of reminds me of Classic ASP with some MVC thrown in. I haven’t built anything yet using it, but I would like to, at some point.

  4. Hi Marty,

    I have a question…

    I developed a Suitelet Form available externally, and used a RESTlet to get the information from the form to create a record.

    In order for the RESTlet to be intialize we must pass credentials, etc in the Suitelet… is this a security risk?

    Can the credentials some how be exposed?

    Thanks,
    David

  5. Hi Marty,

    I must have confused you with the last post.

    My implementation works, I just wanted to know if there were any security risks.

    Here’s the logic behind the implementation:
    1. Create Suitelet Form
    2. The deployment of the Suitelet form will be available without login – accessible outside NetSuite through External URL
    3. Create RESTlet to create record based on Suitlet Form input
    3a. Suitlets available without login have limited API’s – RESTlet allows the use of nlapiCreateRecord
    4. Suitelet Form contains header information and credentials to be passed to RESTlet, as well as the JSON string data (form input)

    Are there any risks with the Suitelet form, which is available without login (avaible via external URL), containing the login credentials?

  6. I’m really interested in using this method to get a user’s cart data from outside the netsuite.com domain. Possible?

    We’re running into an issue where users’ cart data isn’t available to suitescripts, but that seems crazy. Why wouldn’t you expose that data? Is there NO way to get cart data from outside netsuite.com? We’ve also tried sending the request through a proxy, but then it’s not possible to get the user’s cart ID to send as part of the request headers.

  7. Is there a unique ID for shopping carts that we can access for use in an API call?

    When a user adds an item to the cart we would like to send the cart’s ID in the API call so we can track abandoned carts.

  8. Hi Marty ,
    Thank you for you helpful articles. I have a question. I have an MVC application with Login using Netsuite Credentials (Suitetalk) and through the app i perform search, insert , and update. Now we need to open this application directly from netsuite customer page through a button. Once the MVC application is launched, it should not ask for the user credentials since they already logged into netsuite. How do I do this ? any help is greatly appreciated . Thanks

  9. I have an integration with ShipStation where Shipstation makes a GET request to a Suitelet (ENDPOINT) and the Suitelet internally calls (with oAuth) a Restlet to get the data. This works fine.

    The issue is, Shipstation is supposed to send the response (the shipping details like Tracking number etc.) to the same ENDPOINT, as “POST”. It fails with “405 Method not allowed” error.

    I have checked the deployment, Available without login, Run as Administrator , Event Type (tested with alloptions: BLANK, GET request, POST request). No Success

    After readign this post, I added &callback=? at the end of the endpoint.

    Nothing works.
    Can you suggest anything ?

  10. Manoj,

    I’m not sure if you’ve already found a solution to your issue, but I encountered that message when I setup my OAuth suitelet as well. The fix that worked for me was adding a header to my request for User-Agent:Mozilla/5.0

  11. Michael: Yes I used the same. Actually, Shipstation doesn’t Allow to modify the header, so I ended up introducing an intermediate script which transforms the Response and request by adding this. So I am good for now. Thanks

  12. Hello Marty,

    Can you share with me the code of this, I already sent you a message.
    I am a newbie and learning still these technologies.

  13. Hey,

    I am running into trouble similar to the above article when trying to load a file in an iframe of a suitelet. I’m getting the error that “Blocked a frame with origin… from accessing a cross-origin frame”.
    Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *