Function to open the popup window for entering the required lot number and quantity for inventory detail..

From the Suitelet page 1, upon clicking the Inventory Detail will open a popup window by using client script.

Function used in client script is added below.

function showPopupWindow(recValue) {

      try {

        let locationId = recValue.getValue({

          fieldId: ‘custpage_location’

        });

        let itemId = recValue.getCurrentSublistValue({

          fieldId: ‘custpage_item’,

          sublistId: ‘item_sublist’

        });

        let itemName = recValue.getCurrentSublistText({

          fieldId: ‘custpage_item’,

          sublistId: ‘item_sublist’

        });

        let itemQuantity = recValue.getCurrentSublistValue({

          fieldId: ‘custpage_item_quantity’,

          sublistId: ‘item_sublist’

        })

        let leftPosition, topPosition;

        leftPosition = (window.screen.width / 2) – ((600 / 2) + 10);

        topPosition = (window.screen.height / 2) – ((600 / 2) + 50);

        //Define the window

        let params = ‘height=’ + 600 + ‘ , width=’ + 600;

        params += ‘ , left=’ + leftPosition + “, top=” + topPosition;

        params += ‘ ,screenX=’ + leftPosition + ‘ ,screenY=’ + topPosition;

        params += ‘, status=no’;

        params += ‘ ,toolbar=no’;

        params += ‘ ,menubar=no’;

        params += ‘, resizable=yes’;

        params += ‘ ,scrollbars=no’;

        params += ‘ ,location=no’;

        params += ‘ ,directories=no’

        let externalURL = “https://6714807-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=2047&deploy=1&compid=6714807_SB1&h=54c70599c75fc7e4ea05” + ‘&item=’ + itemName + ‘&quantity=’ + itemQuantity + ‘&location=’ + locationId + ‘&itemValue=’ + itemId;

        window.open(externalURL, ‘_blank’, params);

      } catch (e) {

        console.error(‘Error in showPopupWindow:’, e);

      }

    }

Leave a comment

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