Skip to content Skip to sidebar Skip to footer

How To Change A Field Type In Netsuite?

I am trying to create an online form using Netsuite. We have a set for predefined fields like firstname, lastname, etc. In the same we have a NLSUBSCRIPTIONS tag but the field

Solution 1:

If you use a custom template you can hide the drop-down and iterate its options to create your own checkboxes.

e.g.

<divclass="regFieldWrap"><spanclass='cbExpand hideNsLabel'><NLCUSTENTITY_LIST_FIELD></span><inputclass="otherShadow valid"type="text"name="custentity_list_field_other"><spanclass="multiProto cbHolder"><inputtype="radio"name="custentity_list_field"><labelclass="cbLabel"></label></span></div>

and then

<script>jQuery(function($){
        // convert multi select to checkbox
        $("span.multiProto").each(function(){
            var proto = this;
            var selName = $(proto).find("input").attr("name");
            var otherCB = null;
            $("select[name='"+selName+"']").css({display:'none'}).each(function(){
                var sel = $(this);
                var isReq = sel.hasClass('inputreq');
                if(isReq) sel.removeClass('inputreq');
                sel.find("option").each(function(){
                    if(!this.value) return;
                    var newby = $(proto.cloneNode(true));
                    var cb = newby.find("input").val(this.value);
                    if(isReq) cb.addClass('cb_selectone');
                    newby.find("label.cbLabel").text(this.text);
                    $(newby).removeClass('multiProto');
                    if((/\bother\b/i).test(this.text)){
                            var otherField = $("input.otherShadow[name='"+ selName+"_other']").each(function(){
                                var newOther = this.cloneNode(true); // strange but it gets around an IE issue
                                $(this).remove();
                                $(newby).find("input").data("conditionalOther", newOther);
                                newby.get(0).appendChild(newOther);
                            });
                            otherCB = newby;
                    } else proto.parentNode.insertBefore(newby.get(0), proto);
                });
                sel.get(0).options.length = 0;
            });
            if(otherCB) proto.parentNode.insertBefore(otherCB.get(0), proto); // make sure this is the end element
        });

});

Post a Comment for "How To Change A Field Type In Netsuite?"