How to create alert based on suitelet button in suitelet page

 Here, we just show the alert and moving back to the previous page.

 function alertExpense(scriptContext) {

            try {

                let html = ‘<script>alert(“Please add expenses before submit.”);window.history.back();</script>’;

                scriptContext.response.write(html);

            }

            catch (e) {

                log.error(“error@alertExpense”, e);

            }

        }

 if (sublistLineCount == 1) {

                                alertExpense(scriptContext);

                            }

Leave a comment

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