This article is relevant if you are are developing a NetSuite Suitelet and you want to show it in a NetSuite Portlet.
Background
The great thing about NetSuite Suitelets is the ability to programmatically create user interfaces. The general way you call a Suitelet is by passing the URL from a custom NetSuite workcenter menu item. However, sometimes, you want to have a Suitelet draw in the context of a dashboard using NetSuite’s Portlet technology. It almost works… The challenge is that the NetSuite drop down select list technology is known to not work. See NetSuite’s private user group thread on the subject. Basically, the client side scripts stop working.
The DHTML Workaround
In these cases, the workaround we developed is to code for standard dynamic HTML select boxes and binding a Javascript onchange (or other) event to mimic the behavior we want. While this departs from the actual NetSuite standard drop down look and feel, it gets the job done. The fortunate thing is that you can name your html SELECT elements with the exact same ID that NetSuite uses for its Suitelet. For example, name your SELECT element “custpage_mySelectDropDown” and then continue to read values from normal nlapi calls.
Remember, when ever you are performing client side NetSuite development, you have much more control over the environment when you go outside the standard NetSuite SuiteScript API.
If you are looking for help to enhance your NetSuite environment, contact us.
Hey Marty. So This is a solution I thought about but I’ve decided to go the other way given my situation.
I made the Suitelet so that if the request is coming from Portlet, Portlet generates the form fields instead of Suitelet. In this case, Suitelet will be processor of the request. If request is not portlet, Suitelet will generate the form fields.
Hi Joe,
That make sense. We had a pretty complex Suitelet that we need to draw out so we didn’t have that option.
Best.
Marty
I was able to change the drop down to a radio button field and it works just fine in the portlet. That is another option.