How to pass values to URL as params

   try {
                openBoxFilterObj.itemName = openBoxObj.getValue({ fieldId: "custpage_itemname" });
                console.log("Item Name", openBoxFilterObj.itemName);
                openBoxFilterObj.brandFilter = openBoxObj.getValue({ fieldId: "custpage_brand" });
                console.log("Brand Filter", openBoxFilterObj.brandFilter);
                openBoxFilterObj.classFilter = openBoxObj.getValue({ fieldId: "custpage_class" });
                console.log("Class Filter", openBoxFilterObj.classFilter);
                openBoxFilterObj.location = openBoxObj.getValue({ fieldId: "custpage_itemcurrentlocation" });
                console.log("Location", openBoxFilterObj.location);
                console.log("Open Box Filter Object", openBoxFilterObj);;

                var initialURL = 'https://359045.app.netsuite.com/app/site/hosting/scriptlet.nl?script=2097&deploy=1';
                var params = ""
                for (var key in openBoxFilterObj) {
                    params += "&" + key + "=" + openBoxFilterObj[key];
                }

                var generatedURL = initialURL + params;
                console.log("Generated URL", generatedURL)


                return (window.location.href = generatedURL);


            }
            catch (e) {
                log.error({
                    title: e.name,
                    details: e.message
                });
            }

Leave a comment

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