how to Delay GL posting until a certain criteria i...
# ask-stanley-ai
n
how to Delay GL posting until a certain criteria is met
c
AI generated answer (using internal Slack threads):
In NetSuite, there isn't a native way to delay GL posting until a certain criteria is met. However, you can achieve this through scripting. You can create a SuiteScript that listens for the appropriate trigger (like a record being created or edited), checks if your criteria are met, and then performs the GL posting. For example, if you want to delay GL posting until a certain department is selected, your script could listen for the 'afterSubmit' event on the relevant record type, check if the department field has the correct value, and then perform the GL posting if it does. Here's a very basic example of what this might look like:
Copy code
javascript
function afterSubmit(scriptContext) {
    var record = scriptContext.newRecord;
    var department = record.getValue('department');
    
    if (department === 'G&A') {
        // Perform GL posting
    }
}
Please note that this is a simplified example and you would need to replace the comment with the actual code to perform the GL posting. Also, you would need to deploy this script and associate it with the correct record type. Remember, GL Plugins are executed on every transaction's edit operation, even if the edit only happens at the body level. Your GL plugin must run its logic every time the record is created or edited, it's a recurrent event. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.779347181
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.757596731
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.755146921
Please provide your feedback on this answer.