Goal: replace the standard popup search that appears when I click on the search icon of a multi-valued field with a scriptlet that builds its own search form and then displays the results on a results page.
NetSuite Giving did this coding for us awhile ago. The following code is attached to a custom field:
<script language="JavaScript">
function openChild(file,window) {
childWindow=open(file,window,'location=no,toolbar=no, menubar=no, resizable=yes,scrollbars=yes,width=700,height=320');
if (childWindow.opener == null) childWindow.opener = self;
}
var URL="https://system.netsuite.com/app/site/hosting/scriptlet.nl?script=1&deploy=1";
if (document.getElementById("custentity_cust_search_for_referrals_popup_search")!=null){
if(window.isIE) {
document.getElementById("custentity_cust_search_for_referrals_popup_search").onclick = function(){openChild('https://system.netsuite.com/app/site/hosting/scriptlet.nl?script=1&deploy=1');}
} else {
document.getElementById("custentity_cust_search_for_referrals_popup_search").setAttribute("onclick", "openChild('https://system.netsuite.com/app/site/hosting/scriptlet.nl?script=1&deploy=1');");
}
}
</script>
this field uses the customers record.
The form "custentity_cust_search_for_referrals_popup_search" is the in-the-code name for the popup form that would normally appear.
The URL is a deployed scriptlet that creates the search form, accepts criteria from the form, then displays the results.
This setup works in the custom form for one multi-search field. However when I set up a second custom field, change the reference to the popup form, I get an error "FIELD NOT FOUND" when the tab with the multi-select field is opened and when I click on the search icon for the second multi-select field, the standard poplup form appears.
Any thoughts on what the error may be referring to?
Thanks
NetSuite Giving
The script works by checking to see if a particular standard popup form is opening, then replaces that form with my script. The