Marty Zigman - The NetSuite Expert

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Prolecto Labs Accelerator Templates

Video: Learn how to Avoid NetSuite “Do you want to leave this site” Message

NetSuite Technical

Tags: ,

This article is relevant if you are a NetSuite SuiteScript developer and you want to improve the user experience of your SuiteLets and other NetSuite forms.

Background

When working with NetSuite record data, NetSuite tries to help you not lose your work by warning you with a message: “Do you want to leave this site? Changes you made may not be saved.” with a “Stay or Leave” option.   There are times that you simply don’t want this message.

In some recent SuiteLet development work, I needed to ask the user for information that was available via a drop down.  Once information was selected in the URL, I wanted to reload the SuiteLet passing the information as a parameter in the URL.   NetSuite dutifully would warn as I tried to automatically navigate away to a new page.  I wanted to avoid the message as it produced an undesirable experience.

Client Side Script to Resolve

The key to solve this is to simply wipe away NetSuite’s underlying mechanism producing the warning.  The following JavaScript snippet does this for you in your client side script:

//avoid the standard NetSuite warning message when navigating away
if (window.onbeforeunload){
   window.onbeforeunload=function() { null;};
};

To see this in action, review the following 1 minute video:

NetSuite Innovation Leadership

If you enjoy producing solutions on the NetSuite platform like I do, perhaps it makes sense to work together to help bring advanced innovations to the NetSuite community.  Drop me a message and let’s have a conversation about your ambitions

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - YouTube

About Marty Zigman

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

Biography • Website • X (Twitter) • Facebook • LinkedIn • YouTube

One thought on “Video: Learn how to Avoid NetSuite “Do you want to leave this site” Message

  1. David Deuri says:

    This is a useful solution for bypassing the “Do you want to leave this site?” message in SuiteLets, improving the user experience. However, it’s important to use this carefully to avoid unintentionally skipping warnings related to unsaved data. Always test thoroughly to ensure it doesn’t conflict with other scripts or functionality. Great tip for specific use cases!

Leave a Reply

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