Skip to main content

Posts

Showing posts from May, 2025

NetSuite - Force Single Select on Multi-Select Field

Issue: We had a request from our Stakeholders to change a Multi-Select Field to a Single Select.  The Issue came up with this field being part of a bundle that we use.   We didn't want to deal with this being reverted or causing issues after we updated the bundle in the future, so I cam up with this work around. It is a Client Script that will throw an error to the user if they select more than one, and then it will reduce the selection to one option. /**  * @NApiVersion 2.x  * @NScriptType ClientScript  *  * 2025 Prevents multiple selections in a multi-select field * by showing an error message and removing the last selected value.  *  */ define ([ 'N/ui/message' , 'N/runtime' ], function ( message , runtime ) {     function fieldChanged ( context ) {         var scriptObj = runtime . getCurrentScript ();         var fieldName = scriptObj . getParameter ({       ...