↵ to select ↑↓ to navigate
iVendNext

iVendNext

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Filter Options in Select Field

Say you have two drop-down fields named State and City. State has two values, Karnataka and Maharashtra. City has four values, Bangalore, Mysore, Mumbai, and Pune. You want City to show only the cities of the State you pick.

A developer adds the script in Desk's Client Script. Search Desk for Client Script, make a new one, and choose the form with the two fields as its DocType. See Client Scripts for how a Client Script is made and saved.

The script runs when State changes. It sets the options of City to Bangalore and Mysore for Karnataka, and to Mumbai and Pune for Maharashtra. When State is empty, City shows all four options again.

Filter options in a child table

A developer can also filter the options of a field inside a child table. The script sits on the parent form and sets the filter when the form opens. You give the filter as a field, a comparison and a value.

Example scenario

Say the parent form is Sales Order. Its child table field is named items. You want the item field in each row to show only items from one Item Group. The developer writes a script on Sales Order that filters the item field by that Item Group.

Last updated 2 days ago
Was this helpful?
Thanks!