Sujit Y. Kulkarni
Sujit Y. Kulkarni

Reputation: 1386

Suitelet: How to retrieve selected value from list dropdown?

I have added a dropdown with list feature in my Suitelet, which has customer names in it.

form.addField('fieldX', 'select', 'Select Field','customer');

How do I get value selected by user, in a variable?

Upvotes: 1

Views: 4073

Answers (2)

Suite Resources
Suite Resources

Reputation: 1164

This returns the ID of the selected option:

nlapiGetFieldValue('fieldX')

This returns the text of the selected option:

nlapiGetFieldText('fieldX')

Upvotes: 5

Rusty Shackles
Rusty Shackles

Reputation: 2840

Do you want to get the value after the user has selected it? Then you will need to create an undeployed field changed client script. After creating the script record, you will need to attach it to your suitelet using form.setScript().

If you want to get the value when the user submits the suitelet, you can do that using request.getParameter('fieldX').

Upvotes: 1

Related Questions