How to make changes to core tables when building custom apps?

Suggy
Giga Sage

I am building customer app. but I want to add new custom fields to 'Incident form'. Once everything is done, I want to publish.

Then when I move to QA, I want that custom app + custom field created in INC form also to be available in QA.

 

Issue is - when I am building custom app, I will be in custom scope. when I open Inc form, try to make form changes/create custom fields, I will say you are in different scope and wont allow me to make changes.

 

My goal is, to 'build custom app + create custom field in OOB table (part og global scope) ' and have this as ONE SINGLE repository and publish so that I can easily install it via 'my company application' module 

 

1 ACCEPTED SOLUTION

Suggy
Giga Sage

As per this docs - Allow Configuration | ServiceNow Developer

its possible and thats how developers have done and published in store applications.

so to me, its possible and not a bad practice!!!

OOB table is in scope GLOBAL

You are working in 'ABC' scope. Create a new view, it allows add new fields etc for a table in GLOBAL scope.

View solution in original post

9 REPLIES 9

ryan260moore
Mega Contributor

Hello,

 

Define Custom Field in Global Scope (OOB Table):

When you're in your custom app, it’s essential to reference the Incident table from the global scope to add the custom field. In ServiceNow, fields are usually added to tables within the global scope. You can do this by:
Navigate to the Incident table in the global scope and create the custom field there.
If you attempt to create the field while in a different scope (like your custom app scope), ServiceNow will prevent it. So, ensure you're modifying the Incident table in the global scope (or directly reference it if necessary).
Once the field is created in the global scope, you can use it in your custom app.
Create a Custom App to Reference the Global Table:

In your custom app, you can reference this custom field in your forms, scripts, and business rules by using the global table (incident table) and the newly added custom field.
Since the Incident table is part of the global scope, your custom app can use this field but cannot directly modify it within its scope.
Package Your App for Easy Installation:

Once the custom field is created and the app is built, package your custom app, including the reference to the custom field.
You can use the ServiceNow application repository to package your custom app and then install it on the QA environment.
To do this, go to System Applications → My Company Applications, and create a new application or use an existing one to install the packaged app in QA.
Publish and Install on QA:

After the app is built and packaged, move to the QA environment and install the app from My Company Applications.
The custom field will be available on the Incident form in the QA environment because it's part of the global scope.
Workflow Summary:
Create the custom field in the global scope for the Incident table.
Build your custom app referencing the global table and custom field.
Package and publish the app.
Install the app in QA via the My Company Applications module, ensuring the custom field is available.
This approach ensures that you can build and deploy the app in both your development and QA environments while keeping the custom field in the global scope, making it available in all instances.

 

Best Regards

Hi @ryan260moore 

'Create the custom field in the global scope for the Incident table.' ----- How should I capture this? 

Are you saying:

1. Create a custom field in global scope on INC form (say a new update set in global scope)

2. Create a custom app in studio, refer the incident table's custom field.

3. Publish the custom app.

Note - I will just ignore 1st step now. (will ignore the update set created in 1st step

Next, if I publish the app in PROD, will that custom field be automatically be available in PROD ?

Mark Manders
Mega Patron

That's not possible and also bad practice. 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi @Mark Manders I recently installed an app from ServiceNow store and I could see that, it installed the app and also created custom attributes in OOB cmdb tables. How that would be possible?