The start date prepopulates on a case when it is c...
# ask-stanley-ai
s
The start date prepopulates on a case when it is created - how can I have this field be empty?
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To have the start date field be empty when a case is created, you can create a simple workflow or a User Event Script that sets the field to empty on record load. However, this will require the user to manually input a date. Here's a basic example of how you could set up a User Event Script:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 */
define(['N/record'], function(record) {
    function beforeLoad(context) {
        if (context.type === context.UserEventType.CREATE || context.type === context.UserEventType.COPY) {
            context.newRecord.setValue({
                fieldId: 'startdate',
                value: null
            });
        }
    }

    return {
        beforeLoad: beforeLoad
    };
});
This script will set the 'startdate' field to null whenever a new record is created or copied. Please replace 'startdate' with the actual ID of your start date field. Please note that the COPY button triggers a User Event type of COPY, so just handling on create will not clear it out. There isn't a field setting that overrides what COPY does. Also, be aware that this solution might not be suitable if you need to switch back and forth easily between 'empty' and other criteria like 'on a specific date'. In such cases, you might need to use a date formula in the criteria of a saved search.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804321408
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803222656
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800048828
Please provide your feedback on this answer.