You need to sign in to do that
Don't have an account?
Steven Vawdrey 13
Apply a time-delay when clicking Submit
We use a custom Sales Order object that submits data to NetSuite, our company's ERP. It has been requested that we provide the ability to add a delay to the submission. For example, all required data has been provided in the sales order but the user does not want to actually submit the order for a few days, weeks, etc. Instead of setting a task reminder or tracking sales orders in a list view, our users would like to be able to provide a date/time, click Submit, and have the sales order officially submit on the date/time identified. The date and time fields could either be individual custom fields on the sales order or better yet, fields that display in a pop-in when the Submit button is clicked (defaulting to current day time).
Is this possible?
Is this possible?
We have a custom Submit Order button on our custom Sales Order object that pushes order data to NetSuite, our ERP. I've created a Time-delayed Submission? checkbox and a Submit Sales Order On date field. If the Time-delayed Submission? checkbox is checked, and the Submit Sales Order On date entered is > TODAY(), I'd like the Submit button to change the status of the Sales Order to Pending Submission (this would be a new status value).
The current Javascript code on the Submit Order button is:
{!REQUIRESCRIPT("/soap/ajax/36.0/apex.js")}
(function() {
function unescapeHtml(safe) {
return safe
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, "\"")
.replace(/'/g, "'");
}
var errors = sforce.apex.execute('OrderServices','submitOrder',{'orderID':'{!NetSuite_Sales_Order__c.Id}'});
if(errors.length)
{
var errorMessage = errors.join(' ');
alert(unescapeHtml(errorMessage));
}
else
{
window.location.reload();
}
})();
Do I create a time-delayed workflow that sets the sales order status to Pending Submission. Or do I use Process Builder to somehow submit the order on a future date without having to manually click the Submit Order button? I'm having a hard time thinking through this and any help you all might have would be so appreciated!
Steve