How do I create a select field in a suitelet for e...
# suitescript
t
How do I create a select field in a suitelet for entities similar to how netsuite handles it? In the UI you can filter by type of entity, like customer, employee, etc. When I create a select field for an entity, the field is just blank with no select options. I can manually add all the options I need but how can I add the same filtering logic? This is a field in a sublist
Copying the first result you see on google doesnt help. Maybe re-read my question because this is clearly not what I was asking simple smile
If anyone has advice on this, please let me know. It seems the filtering netsuite does by default with entity fields is some logic not accessible in suitelet fields. I can addSelectOption but theres nothing to categorize this
j
Can you post a screenshot of what you mean by “In the UI you can filter by type of entity, like customer, employee, etc.”
t
for example this is what happens if I add a field to a record through the UI. It has this extra dropdown menu which lets me select the type of entity
j
what page are you on there?
t
This is just a custom record where I now added a field through the UI, of type list/record
In my suitelet I was trying to see if it's possible to add similar logic where I can filter on the options in my select field. I have no problems adding every entity I need to the select options, but it's all just displayed in one list with no filtering or searching capabilities either.
j
Do you mean you set up your custom field like this and you want to do the same with suitelet
t
Yes that's what im referring to for the screenshot
j
hmmm haven’t seen that sort of thing before in a Suitelet. Suggest you create a dropdown yourself for the Type of Entity, then one drop-down for each type, and hide/show using Client script based on what is selected in yoru Type dropdown.
👍 1
t
I was hoping to avoid that but yea that might have to be the option
c
I know you're going down the suitelet path, but if you get a chance I would also check out the single page applications (SPA) that use the new UIF framework. This is what is going to be replacing suitelets so it may be worth it to take a look at and maybe implementing using that.
t
from what I've seen, that requires more custom logic compared to what suitelets already implement. it doesn't seem all that enticing at the moment if a suitelet can handle what I need. I'll definitely look into it in the future but already made most of this suitelet logic and now realized I need a different field from what I'm using
c
I gotcha. I was just spreading the word as I didn't even know they existed until recently
j
I saw them at SuiteWorld a couple of years back but they were still fairly new and limited at that time.
n
For SPAs, I think you need partner ID as they are enabled by NS for specific accounts? It's not generally available. @creece Please prove me wrong as I am also looking forward to try SPAs in NS. From NS Docs: _You use SuiteApp projects created with SDF to develop and deploy SPAs in NetSuit_e In NetSuite, SPAs are built as part of an SDF SuiteApp project and includes these components:
c
I believe it went GA in 25.1. Any new accounts we've created or existing accounts on 25.2 all have it. You just create an SDF app and can add it in and deploy it. I did not need a partner ID for anything.
🎉 1
n
I will give it a shot! Thanks @creece
When I am trying to deploy, it says Publisher ID is invalid. I have created a SuiteApp project. @creece
e
Use client script to filter dropdown lists.
d
@creece why do you say SPAs are what will be replacing Suitelets? i can't seem to find documentation on that, although i do see they're able to offer the same kind of functionality and they are a bit more modern so it kinda makes sense. i just don't see anything official on it
n
They are only available to SDN partners @Derek Jackson. So, it is unlikely SPAs will replace Suitelet.
d
interesting, interesting. why are SPAs then? i'm currently playing around with a sample one in my company's sandbox rn and thinking about taking a custom suitelet i made for a client recently and converting it into an SPA, just to get acclimated. i'm having a hard time figuring out if i should move forward to learn the future or if these SPAs are just going to be super niche and not worth learning
n
Anything not generally available to other DEVs should be considered as super niche - IMO.
c
They are just way more powerful than suitelets. Once anyone can make them, I don't see why you would ever use a suitelet again for UI related things. Using suitelets as a middleman will still have some value (like creating a PDF file to display or separating logic from client side). To be fair though, this is an entirely different skillset as it's basically netsuite's own flavor of reactJS.
d
yeah, they are very React-y but i like that. i like react a lot, but it's definitely been a minute. i think i'll sink some time into this and play around. there's clearly been a lot of work and thought put into these, it just seems weird that they're still not widely available to all devs though.