Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Edit: For the New York release, we introduced a new concept to Scoped Applications, called the author_elective_update folder. When your application is packaged for the repo or for committing to Source Control, we will unload additional things into this folder that we would previously have ignored. The author_elective_update folder is where we will unload Deletes. When your application is installed on your own instances, we will automatically load these Deletes from the author_elective_update folder. Please refer to New York and Scoped Applications - some new features blog by Cory Seering.

Pre New York release:- If you are doing enhancement changes on an author instance, please be aware that deletion of records like business rules, client scripts, etc. will not be tracked in your scoped application file. In the past, I have seen a lot of vendors on store assuming that deleted entries will be shipped as part of their scoped app file. In this post, I will show you how to capture deletion of records in scoped application as well as what to do if you accidentally delete them. This is applied for those apps which have the first version of the app already published on the store or app published to company's target instance via make app available to other instances.

 

Deletion entries are not packaged as part of app file; for example, any delete action will not be recorded as part of scoped application file. Instead of delete, you need to set the active field of the record to false.This will ensure that the changes are captured and packaged as part of update file in the next version. For those records which don't have an active field on the form, please ensure to set the description field with message "This file is deprecated and is no longer required". Please refer the screenshot attached for reference.

 

Example of deleting records on a scoped app

Let's pretend we created a scoped application   called "Marketing Events" v1 which is already published on the store and is installed on customer instance. I need to make some additional changes on top of v1 and publish it to the store so that customers can install it as a part of the update file. My requirement in v2 is to delete a business rule and system property which was created earlier as part of the v1 app. We can do this tracking the changes related to deletion.

 

Steps to track changes related to deleting the business rule and system property

  1. Navigate to the business rule you created in v1
  2. Set an active field to false.

 

For "sys_properties" table, we don't have an active field in the base system. For those records which don't have an active field we recommend you to just update the description field with the message, "This file is deprecated and is no longer required." The same steps will be followed for any records which don't have active field in the base system.

The above changes will be captured as part of the update in version V2 and will be successfully migrated to customer instance as soon as update file is installed.

 

What to do in case records are deleted by mistake on source instance:

If you have already deleted the records, there are two ways to retrieve them.The first is restoring the deleted records, and the second is to ask ServiceNow for help.

 

  1. Try to restore those records from deleted records module. In Using the Restore Deleted Records plugin to retrieve lost data the process to do so is outlined.
  2. Get in touch with certification team at ServiceNow. We will provide you the report with diff results of all records between the current version and the already certified version on the store. This diff file is given to you so that you can write a fix script which will then delete those records on customer instance. Once the app is upgraded customer has to make sure that the script is triggered in the global scope.This option is only for vendor's who has the app already published on the store and is in use on customer instance. You can refer to Fix scripts for more information.   THIS OPTION IS NO LONGER SUPPORTED.

 

I recommend setting the records as active=false (most metadata types allow for active true/false). For those records which don't have an active field on the form, please ensure to set the description field with message "This file is deprecated and is no longer required."

24 Comments