when changing customer on estimate, how to prevent...
# ask-stanley-ai
t
when changing customer on estimate, how to prevent changing taxcode on line or changing it back to previous
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 prevent the tax code from changing when you change the customer on an estimate, you can use a client script in NetSuite. This script will ensure that the tax code field on a sales order line is not editable, and it will default from the customer record. Here is a general idea of how you can achieve this: 1. Create a client script that targets the tax code field on the sales order line. 2. In the script, use the
validateField
function to prevent changes to the tax code field. This function is triggered whenever a field is changed and it can be used to prevent changes to specific fields. Here is a sample code snippet:
Copy code
javascript
function validateField(type, name) {
    if (name == 'taxcode') {
        return false; // This will prevent changes to the tax code field
    }
    return true;
}
Please note that this is a simplified example and you may need to adjust it to fit your specific needs. Another approach is to set the column header for the tax code field to blank on the form. This will hide the tax code field but still store it with the form. This method was suggested in one of the conversations and it seemed to work well for the user. Remember to test any changes thoroughly to ensure they work as expected and do not cause any unintended side effects.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.797363281
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.794311523
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.791564941
Please provide your feedback on this answer.