Suitelet Bug? currentRecord.setValue()
Has anyone experienced a bug where currentRecord.setValue() does not work on clientScript of form, getting error “selectmap is not defined”
I have narrowed this down to being on SELECT fields that are added to the form on POST request method, and when they are popup style (i.e. values/text need to be queried rather than showing up in dropdown)
This appears to be because the Suitelet client script runs a GET request query to get the appropriate Label to populate in the field, but the response comes back empty (I assume since the field was added on POST, it isnt aware of the fieldId on a GET request)
This is behavior related to the
preference. Requests that get a list for your select field generate a GET request to your suitelet. Your suitelet is supposed to write back the same page object (or if for some reason you are being ultra efficient, a page object with the field being requested).
You can log the request parameters to see what the parameters for the GET are. I’m not sure which is ideal for determining if the GET is this sort of request since this is undocumented behavior.