safety-net

Nested Dropdown Lists in NetSuite

#custom record #dropdown #nested #netsuite

Data accuracy should be a top priority in any system-related project and preventing users from entering data that doesn’t make sense will make designing processes and reports much easier. When categorizing objects in many applications, it’s common to use drop down lists for fields such as Category and Sub-Category to help identify objects in reports. By using nested drop down lists, you can ensure that the selected Sub-Categories are relevant to the selected Category. Nested drop down fields can be easily created in NetSuite. It’s just not immediately obvious because you’ll need to use custom records rather than custom lists.

In this example, we’ll create two drop down fields on the customer record called Category and Sub-Category. When we select an item in Category, we’ll see that the available options in Sub-Category will dynamically change to show only items that correspond to our Category choice.

To begin, we’ll create a new Record Type called Categories. To do this,

  • Navigate to Setup -> Customization -> Record Types -> New
  • Enter ‘Categories’ in the Name field and click Save

You can set any other options that you’d like but this is all we’ll need for our example. After creating the record type, click View Records. Add three new records and in the Name field of each record, enter A, B and C. This will give us our three customer categories.

Next, we’ll create another very simple Record Type called SubCategories using the following steps:

  • Navigate to Setup -> Customization -> Record Types -> New
  • Enter ‘SubCategories’ in the Name field and click Save
  • On the Fields sub tab, click Add Field then enter the following values:
    • Label: Category
    • Type: List/Record
    • List/Record: Categories (the record type we just created)

The additional field in this record defines the relationship between our Category and Sub-Category fields. After creating the record type, click View Records then click New to create our sub-category record. Create nine new records with the following values:

Name       Category
 A1          A
 A2          A
 A3          A
 B1          B
 B2          B
 B3          B
 C1          C
 C2          C
 C3          C

Now that all of our SubCategories are in place, we just need to create our new Customer fields that use these new record types.

To create the Category field, navigate to Setup -> Customization -> Entity Fields -> New and enter the following values and click Save:

  • Name: Category
  • Type: List/Record
  • List/Record: Categories
  • Applies To: Customer

Just like the Category field, we’ll create the Sub-Category field by navigating to and Setup -> Customization -> Entity Fields -> New and enter the following information but don’t click Save yet.

  • Name: Sub-Category
  • Type: List/Record
  • List/Record: SubCategories
  • Applies To: Customer

The only thing left is to tell NetSuite that the available values in this field are dependent on what is selected in our Category field. To do this, click on the of Sourcing and Filtering tab and select Category for both the Source List and Source Filter By fields. Now click Save.

Open any customer record and click on the Custom tab, you’ll see the two new fields that we just created, Category and Sub-Category. If you select Category A, then you’ll see that only A1, A2 and A3 are available to select in the Sub-Category field.