Where did it go? How to Retain the Copy Employee List on NetSuite Support Cases

by | Jan 18, 2024 | Tech Talk

Introduction:

Recently we had a client that came to us with an issue they had with NetSuite Support Cases.  They often use the Copy Employees field to select additional employees to email Support Case updates to when they add messages to their cases.  The challenge was that the Copy Employees field was cleared every time they saved the support case, requiring someone to reselect one or more employees every time they updated the case records to communicate with their customers.

Goal:

To combat this inconvenient behavior within the NetSuite case management we were asked to investigate how to retain the list of selected employees previously entered on the Copy Employees field without having to ‘re-update’ the copy employee list every time the case record is updated.

Solution:

Since the Copy Employees field is a Native NetSuite employee center or field that is cleared every time you save the support case record, we are unable to alter the direct behavior of this field within the system.

Instead, we created a custom employee multi-select field called “Case Email CCs” that would be used to select multiple employees and then save the selected values when the support case is saved.  Next, we created a client script that would use the field Changed event to update the native Copy Employees field with any changes to the custom employee Case Email CCs field immediately.

We also used the pageInit function in the client script to populate the native Copy Employees field with the saved values from our custom field Case Email CCs when the form was initialized in Edit mode.

The use of these two functions in tandem ensured that we were able to not only set the values in the native field but could also retain them any time a support representative made a change to the custom field or NetSuite employee center.

fieldChanged Example

Example of the fieldChanged method used to set the native Copy Employees field upon changes.

function fieldChanged(context) {
        try{
            var supportCase = context.currentRecord;
            var fieldId = context.fieldId;
            if(fieldId == 'custevent_case_email_cc') {

                var emailcc = supportCase.getValue('custevent_case_email_cc');
                if(emailcc.length > 0) {
                    supportCase.setValue('emailemployees', emailcc );
                }
            }
        } catch(error){
            log.debug('fieldChanged: error', error);
        }
}

pageInit Example

Here is an example of the pageInit function used to set the values when entering Edit mode for the case record.

function pageInit(context) {
        try{
            var supportCase = context.currentRecord;
            var supportCaseId = supportCase.id;
            var emailcc = supportCase.getValue('custevent_case_email_cc');
            var emailemployees = supportCase.getValue('emailemployees');
            if(emailcc.length > 0) {
                supportCase.setValue('emailemployees', emailcc );
            }
        } catch(error){
            log.debug('beforeLoad: error', error);
        }
}

The Results

Conclusion:

By using a custom field and two small functions in a client script we were able to retain the desired list of Employees to copy on any support case updates for the client.  By using this method, we were also able to achieve this goal while still using the native NetSuite field explorer and functionality to copy employees on Support Case update emails without having to interrupt that natural process within the system.

Our client was extremely pleased with how well this new process worked for them, especially how seamlessly it integrated with the natural flow of their case management procedures.

About Us

We are NetSuite experts with 30+ years of combined experience.  We specialize in implementation, optimization, integration, rapid project recovery and rescue as well as custom development to meet any business need. Although every business is unique, with 40+ NetSuite clients over the last 5+ years our team has most likely seen your challenge or created a similar solution. If you need any kind of NetSuite customizations or just have questions on your project, feel free to contact us Here.

Join our mailing list to stay up to date on the latest NetSuite solutions.