<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=523033&amp;fmt=gif">

Auditing Script and Workflow Changes in NetSuite

Fotolia_100798379_Subscription_Monthly_M.jpgScripts and workflows are typically at the heart of NetSuite customization with functionality ranging from simple data validation to advanced approval processes and completely custom business processes. Both scripts and workflows can have a large impact on the business and the integrity of transactions being processed through NetSuite. With this in mind, it is important to maintain a grasp on any and all modifications made to the scripts and workflows in your NetSuite production environment. This post will provide options that exist in NetSuite out of the box for auditing changes to scripts and workflows.

 

Note: This post does not cover the implementation of a proper change management process. It is assumed that a robust change management process is already in place, with source control applied to both scripts and workflows where possible.

 

Scripts

Permissions required:

  • Documents and Files: View
  • Perform Search: Full
  • SuiteScript: View
  • Scripts in NetSuite consist of three components:
  • Source files: JavaScript and other files that make up the business logic contained in the script. These files are stored in your NetSuite file cabinet. Typically, you can find source files in the SuiteScripts or SuiteBundles folders.
  • Script record: defines the type of script and links to the source files that contain the relevant business logic.
  • Script deployment record: defines how the script is triggered, including the audience. The audience specifies which users a given script will run for in NetSuite. Without a deployment, scripts will not run.

From an auditing perspective, it is important to track changes to all components of a script record, from the source file all the way to the deployment. Each component can be changed individually and have an impact on data integrity.

 

Source Files

For source files, a NetSuite saved search can be used to see all changes, including the date of the change and the user who made the change. These changes can then be tied back to a change management process. To view these changes, create a new search as outlined below:

 

1. Create a new saved search for the ‘Document’ record type

Auditing Script.png 

 

2. Add a new filter for the ‘File Type’ field. Typically, script business logic will be contained in JavaScript files with a .js extension. However, it is possible that other file types are included in a script’s execution. To limit your search to JavaScript files, add a filter for ‘JavaScript File’.

file type.png

 

3. To see when the file was last changed and who made the change, add the following fields under the ‘Results’ tab:

  • Name
  • Type (file type)
  • System Notes: Date (when the change was made)
  • System Notes: Set By (who made the change)

 

4. The results of the saved search will display the script file name, when it was last changed, and who changed the file.

results.png 

 

Note: The process described above will identify changes made to source files, but not provide details on the specific lines of code that were modified as part of the change. It is recommended to use a source control repository to determine specific lines of code that were modified as part of a release.

 

Script / Script Deployment Records

As of the 2016.2 release, both script and script deployment records support system notes. This is great news as system notes will provide field level details with old and new values along with a date of the change and the user who made the change. To view all changes made against scripts and script deployments records, create a new search as outlined below:

 

1. Create a new saved search for the ‘Script’ or ‘Script Deployment’ record type

script deployment.png

 

2.Add a filter for the System Notes ‘Record Type’ field and set to relevant record type, either script or script deployment. Without this filter, it is possible duplicate results or irrelevant results will be displayed. This is due to a bug that exists when running saved searches against script or script deployment records that include a join to system notes.

file type.png

 

3. To see details about the changes made, add the following fields under the ‘Results’ tab:

  • Name
  • System Notes: Context (where the change was made)
  • System Notes: Date (when the change was made)
  • System Notes: Field (field that was changed)
  • System Notes: New Value (new value of the field as result of the change)
  • System Notes: Old Value (old value of the field prior to the change)
  • System Notes: Set by (who made the change)

4. The results of the saved search will show detailed changes against the script or script deployment records in your NetSuite account.

 

Workflows

Permissions required:

  • Perform Search: Full
  • Workflow: Full
    1. The workflow permission only provides ‘Full’ as an available access level.
    2. It is also required that you have ‘Full’ access to the record type set on the workflow definition in order to have visibility into the workflow. This makes auditing workflows a bit more difficult as a potentially wide array of permissions is required to provide visibility into all workflows in the system.

Auditing workflows requires a little more manual work. Unlike scripts and script deployments, workflows do not currently support system notes. This means we can only use saved searches to determine the last time a workflow was modified. From there, we will need to go into each individual workflow to identify changes. To determine which workflows have been changed, create a new search as outlined below:

 

1. Create a new saved search for the ‘Workflow’ record type

workflow.png

 

2.Add the following fields under the ‘Results’ tab:

  • Name
  • Record Type (type of record workflow runs against)
  • Release Status (current release status of the workflow)
  • Date Modified (last date / time the workflow was modified)

3. The results of the saved search will show a listing of all workflows, including the last time they were modified.

workflow list.png

 

Now that we know which workflows were modified, we need to go into the details of each individual workflow to identify detailed changes. Using the search results we generated above, click the ‘Edit’ button next to the workflow you want to investigate further. This will take you into the workflow editor. From here, you will need to click the pencil icon to display workflow details.

test workflow.png

 

Once the workflow details have opened, navigate to the history tab (bottom of the details page) to see details of all changes made to the given workflow.

workflow changes.png