Looking for a way to add a dependant dropdown in a...
# suitescript
e
Looking for a way to add a dependant dropdown in a Suitelet. I have two select fields: 1. The first one is a list of Custom Segment A, unfiltered. 2. The second one is a list of Custom Segment B. The Custom Segment itself is defined as
filteredby
Custom Segment A. In the Suitelet, how do I define this dependency? So far, I have created a form in the Suitelet and added two select fields using
form.addField
. Then, populated the first select field with the Custom Segment A. Then added a client script with a
fieldChanged
entry point. When the first select changes, I get the selected option, then can do a search or query to get the related Custom Segment B. So far, so good. My question is, ¿how do I reset the second dropdown and populated again when the first select changes?
b
e
Thanks a lot!!!
I was confused by
addSelectOption
but your link made clear that
removeSelectOption
belongs to
currentRecord
, same as
insertSelectOption