Any way to load `N/` modules on the home dashboard...
# suitescript
e
Any way to load
N/
modules on the home dashboard? Trying require in the console throws the error:
Uncaught ReferenceError: require is not defined
Wondering if anyone had any (potentially hacky) workarounds?
c
What are you trying to accomplish?
e
Not on the Home page, I don't think as it's not scriptable. You can load them on any scriptable page (EDIT view of a record, a Suitelet, etc)
e
@Clay Roper - a quick way to be able to run code from the dashboard (i.e. running quick searches and displaying results). It would be masked by a "command palette" that would be similar to the Global Search but.... actually helpful for power users.
@erictgrubaugh I'm thinking I might write all the logic in a suitelet, then just use POST calls to the suitelet to return any data I'm trying to pull/display quickly
c
I have no experience to speak of with them, but have you looked into Portlets? Also, where does the requirement for it to be on a dashboard come from, and could you pivot to a Suitelet for display as well?
b
Simple Form Portlet specifically
e
Dashboard requirement is just a personal requirement... I'd love for me (and any users) to be able to hit a keyboard shortcut from the homescreen and see a command palette of options (that would be customizable) to quickly run tasks that they perform often FWIW I built this all out in a Chrome Extension, but with Manifest 3 coming "soon", it's going to be much harder to maintain.
@battk I missed Portlet.clientScriptFileId the first time I read that page. I think this opens up a world of possibilities
b
the only technical thing to keep in mind is that the simple form portlet is implemented in an inframe, which is why it has access to require
so if you wanted access to the dashboard window, you need to use the parent
e
Good call out- I'll play around with that and see what I can come up with. Appreciate your input!
e
Working on something similar and the components are: 1. simple form portlet 2. client script 3. html page 4. suitelet
e
@Eric B Curious what you're using the html page for? Also, are you me?
😄 1
e
@ericbirdsall I'm using the HTML page as a template for the layout display which has placeholders that I replace actual values with after making a call to the suitelet. The portlet is just a loading mechanism and all the work is done on the client script so the one caveat is that the portlet can't be collapsed, otherwise the client script won't fire.
This used to work but just tested with latest release and doesn't anymore 🤷‍♂️
e
Dang. That looked promising