Search code examples
netsuitesuitescriptsuitescript2.0

how to create filter fields in suitelet script?


I am trying to create custom filter fields using suitelet script. I tried to create those using select type field, but not getting output like proper filter. Is there any way to create custom filter field in suitelet? Please Help!

Below is my code:

How to get proper custom filter field group and fields?


Solution

  • To add borders to the field group :- like this

        var tableField = form.addField({
                            id: 'custpage_table_field',
                            type: N_server.FieldType.INLINEHTML,
                            label: ' '
                        });
                  
                  var location_ ="location";   // create and set your variable 
                  var htmlitem ="item";
    
                       htmlTable = '<!DOCTYPE html>' +
                            '<html>' +
                            '  ' +
                            '<head>' +
                            '</head>' +
                            '  ' +
                            '<body>' +
                            '    <div id="wrapper">' +
                            '  ' +
                            '        <table border=1 id="table_detail" ' +
                            '            text-align =center cellpadding=8>' +
                            '  ' +
                            '   <thead>'+
                            '            <tr>' +
                             <th height="50" bgcolor="#b8b2b2" font-size:70px   font-weight: bold text-align: center><b>ITEM</b></th>' +
                            '                <th height="50" bgcolor="#b8b2b2" font-size:70px   font-weight: bold text-align: center><b>LOCATION</b></th>' +
    </tr>' +
    '            <tr>' +
     <td >' + htmlitem + '</td>' +
                                '                <td class = "location">' + location_ + '</td>' +
    </tr>'
                            '</thead>'+
                            '       </tbody>'+
                            '        </table>' +
                            '    </div>' +
                            '</body>' +
                            '  ' +
                            '</html>';
               
             tableField.defaultValue = htmlTable;
    
                                 
    

    I hope it will give you an idea.

    If it does help you please vote 1 for my all answer and mark as green as relevant.

    Thanks,