I have a custom record that exists as a sublist on...
# ask-stanley-ai
a
I have a custom record that exists as a sublist on a subtab of another record. When I click 'New Custom Record' it goes to the new record page. I want that to open as a pop-up instead. How can I configure this so it pops out instead of leaving the page I'm on?
c
AI generated answer (using internal Slack threads):
To configure a custom record to open as a pop-up instead of leaving the page you're on, you would need to use a SuiteScript. Unfortunately, there is no built-in configuration in NetSuite to achieve this. Here is a general idea of how you can do it: 1. Create a Suitelet that will serve as the pop-up window. This Suitelet will contain the form for creating a new custom record. 2. On the parent record, you will need to add a button using a User Event script. This button will be used to open the Suitelet created in step 1. 3. The button's function should include a SuiteScript that opens the Suitelet in a pop-up window. You can use the
window.open
function in JavaScript to achieve this. Here is a sample code snippet for the User Event script:
Copy code
javascript
function userEventBeforeLoad(type, form) {
    if (type == 'view') {
        form.addButton('custpage_new_custom_record', 'New Custom Record', 'openSuiteletInPopup()');
    }
}

function openSuiteletInPopup() {
    var url = nlapiResolveURL('SUITELET', 'customscript_my_suitelet', 'customdeploy_my_suitelet');
    window.open(url, 'New Custom Record', 'width=500,height=500');
}
Please replace
'customscript_my_suitelet'
and
'customdeploy_my_suitelet'
with your actual Suitelet script ID and deployment ID. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852225661
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850993752
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849848628
Please provide your feedback on this answer.