<@UHQFWH30Q> are you doing this in a SuiteLet wher...
# suitescript
n
@David Durst are you doing this in a SuiteLet where you have control of the second select? (i.e. creating the form and adding the second select to the form in script)
d
I wanted to avoid a suitelet if possible
I knew that approach, but it would require a lot of work to make the other areas function as well
n
I don't think you're going to be adding / taking options from a select list if the field is defined in the regular way through the UI and applied to a record. Others may be able to definitively confirm.
In the past I've had a 2nd select list that contains everything. 1. Hide the list in edit. 2. Add an empty dummy list 3. On change of the list that drives the process have a client script update the dummy list. 4. On save capture what was selected in the dummy list and update the real list value selected.
d
that would require a list that contains almost every field name for every record in NS…. not really good.
n
Maybe not I'm just offering you a solution for the situation generally, YMMV
d
sorry didn’t mean to offend… just a bit frustrated at how limiting working in SS is
n
No offence taken, I've been working on NS about 8 years it's a constant frustration so I hear ya' 😉
b
my general rule is that anything you cant do in the ui you cant do in script
that said, lucky for you it sounds like what you want can be done in the ui
create a
List/Record
custom field and set its type to
Record Type
that will be your list of record types
you should be able to setup the list of fields the same way without using suitescript by setting up another
List/Record
custom field of type
Field
where its filter restricts the list of values to those whose record type is equal to your first custom field
d
Lets try that ... but it sounds exactly what I need...
Someone should add something like bonusly so you can reward people for awesome answers here
@battk have you actually tried this… maybe I am just doing something incredible stupid here but I can’t seem to get this to work
b
Too much sourcing
Only use the filters (the sublist below the sourcing fields)
@battk ☝️ I tried and its still doesn’t work…. that was my first approach actually and I just figured that I was stupid and was doing something wrong and read a bunch of tutorials which lead me the other direction and neither seem to work in this case.
b
message has been deleted
message has been deleted
message has been deleted
d
I am trying to use it in a sublist so maybe thats the problem
b
try seeing if it works on the custom record itself
without trying for sublist stuff
d
yeah… did that… still not working
I am going to delete the two fields and restart see if that solves it
@battk so the mystery has been solved…. the idea works in principle
If you select a custom record like you have you will get a list of fields
however, if you select a NS Native Record type such as “Case” or “Customer” you will get no field results
b
You can try using filtering only a sourced record field type. but its less exact since if you do something like customer, you get all entity fields
message has been deleted
d
Thank you @battk I believe this should work