Usage of “removeSelectOption” and “insertSelectOption”

Create a search or function to return the selected options as a value and text. For example.

0: [value : 123, text: abc]

1: [value :456, text: xyz]

then add the following code to display the selected options:

Field.insertSelectOption({
                                value: listOfTGFDAFs[j].getValue({
                                    name: "value "
                                }),
                                text: listOfTGFDAFs[j].getValue({
                                    name: "text"
                                }),
                                isSelected: (value == 456) ? true : false
                            });

To remove the select option

 var FieldName= currentRecord.getField({
                            fieldId: 'fieldId'
                        });
                        FieldName.removeSelectOption({
                            value: null,
                        });

Leave a comment

Your email address will not be published. Required fields are marked *