Is it possible to natively close a record window a...
# suitescript
d
Is it possible to natively close a record window after it has been saved? I'm opening a pop-up window in the same way as a Phone Log or Task from a customer (using the
nlOpenWindow()
method) except the record I'm referring to already exists and is in edit mode. However, I would still like the window to close after the record has been submitted the same way the Phone Log and Task window close. Currently it just redirects back to the customer record (the pop-up is opened from a button on the customers activities sublist). I'm aware I could redirect to a suitelet that handles closing the window but I would prefer not to use an extra script. I've tried looking through various modules, custom record and form settings but couldn't find anything
n
Go native js and use an opener?
d
I don't think I follow, that just gives me access to the window that opened the pop-up right? I do want that window to stay open. I want the pop-up to close after the record has been submitted
n
hmm OK maybe your requirement is not what I thought. client script on "save" that performs a window.close()?
d
In saveRecord?
n
yup
d
Okay that works. At first I thought it interfered with saving the record but I forgot to add
return true;
🤦‍♂️ Instead of
window.close()
I ended op doing
setTimeout(window.close, 2000)
so it feels a little more like the Phone Call and Task. Thank you for the help!
👍 1