Duplicate Cases are created when we click ‘Submit’ button again and again

  • Go to: Customization → Forms → Entry Forms or Transaction Forms
  • Edit the Form used in the Online Case/Feedback submission
  • Under “Custom Code” section:
  • Set the Client Script to your deployed script
  • Save the form

/**

*@NApiVersion 2.1

*@NScriptType ClientScript

*/

define([‘N/search’, ‘N/ui/dialog’], function (search, dialog) {

function pageInit(context) {

const form = document.querySelector(‘form’);

const btn = document.querySelector(‘input[type=”submit”]’);

if (form && btn) {

form.onsubmit = function () {

// At this point, the form is valid and about to submit

btn.disabled = true;

btn.value = ‘Submitting…’;

return true;

};

}

}

return {

pageInit: pageInit,

}

  • });

I used the above code in suitescript and check the checkbox ‘available without login’ checkbox.

Then add this file under custom code option.

Now the submit button is disabled.

Leave a comment

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