Andreea Barcan
01/30/2025, 12:17 PMCeligo AI
01/30/2025, 12:17 PMAI generated answer (using internal Slack threads):To create a pop-up message when pressing close on a purchase order, you can use a combination of SuiteScript and SuiteFlow. Here's a step-by-step guide on how to achieve this: 1. Hide the native close order button/action: You can do this on the form itself. This will prevent users from accidentally closing the purchase order. 2. Add a custom field to the order called “close order”: This can be a checkbox. This will serve as your new close order button. 3. Create a workflow with a confirm action: This workflow should be triggered before user submit. The confirm action will display a pop-up message when the user tries to close the order. 4. Add a transition to a new state when “close order = T: This means that when the user checks the "close order" checkbox, the workflow will transition to a new state. 5. In the new state, add a Sublist action group for the items table: Add a set field value action to this group to set line.closed = T. This will close the order when the user confirms the action. 6. Create a client script for the pop-up message: This script will be triggered when the user clicks the "close order" checkbox. The script should display a pop-up message asking the user to confirm the action. If the user clicks OK, the record will save and be closed. If they click cancel, the record will not save and remain in edit mode. Here's a sample code for the client script:
javascript
document.getElementById('closeremaining').onclick=function(event){
let confTxt= "Do you really want to close this order???";
if (confirm(confTxt) == true) {
close_remaining(nlapiGetRecordId(),'purchord')
}
}
Please note that this approach is not officially supported by NetSuite, but it is simple and effective.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
01/30/2025, 12:18 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855200827
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836596131
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835014045
Celigo AI
01/30/2025, 12:18 PM