How can I show some specific values of a dropdown field?

Answered

Hi, I have added a status field in suitescript which have some dropdown values but I want to show some 2 or 3 values only. How can i do this?

var fld_status = o_form_obj.addField(‘status’, ‘select’, ‘Invoice Status’, ‘customlist_prodstat’);

Rookie Asked on June 15, 2021 in SuiteScript.
Add Comment
6 Answer(s)
Best answer

I am imagining something like this:

var fld_status = o_form_obj.addField(‘status’, ‘select’, ‘Invoice Status’);

fld_status.addSelectOption(‘Option 1’, 1);

fld_status.addSelectOption(‘Option 2’, 2);

etc.

Thanks,

Chris

Intermediate Answered on June 24, 2021.
Add Comment

Hi,

The only way to do this is to remove the source (customlist_prodstat) and add values to the list based on a search.

I’d be happy to help if you need further assistance.

Thanks,

Chris

Intermediate Answered on June 23, 2021.
Add Comment

I had tried as suggested but getting blank in that field.

Rookie Answered on June 24, 2021.
Add Comment

Have you also used o_form_obj.addSelectOption to add the options in manually?

Are you able to share part of your code?

Intermediate Answered on June 24, 2021.
Add Comment

// create field for invoice status
//var p_state = nlapiLoadRecord(‘customlist_prodstat’, [1, 2, 3]);//added by t2 on 15 Jun -21
var fld_status = o_form_obj.addField(‘status’, ‘select’, ‘Invoice Status’, ‘customlist_prodstat’);

Rookie Answered on June 24, 2021.
Add Comment

Thanks Chris! It worked for me.

Rookie Answered on June 24, 2021.

Excellent.

on June 24, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor