- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:26 AM
The Area field has the options:
ti and seg: IT in the field system: APP, BRM, CAPTA, GPP
SEG in the system field: SMS, IMS, ACS
Now the problem is, I need to reference it multiple times, so when the Area field is selected the following are presented in the Service Type field:
TI
- Configuration
- Maintenance
- Customization
- Installation
- Consulting
- Backup and Recovery
- Training
- Request
SEG
- Configuration
- Maintenance
- Backup and Recovery
- Training
- Request
- Incident
some fields are repeated and so I am unable to reference them, the first reference I did this way
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 05:45 PM
Start with creating a new Script Include; for that open module "System Definition ↳ Script Includes":
Make sure there is no script include named "Tickets" already (in scope Tickets Register):
Start the creation of a new record by clicking New.
In the new Script Include record set fields:
- Name to Tickets
- Script to
var Tickets = Class.create(); Tickets.prototype = { 'initialize': function () { this._dependentValue = typeof dependent_value == 'undefined' ? '' : dependent_value; this._sessionLanguage = 'en'; // gs.getSession().getLanguage(); }, 'getSericeTypesForArea': function () { return this._getChoiceList(); }, 'type': 'Tickets', '_addRecordToChoice': function (glideChoiceList, record) { glideChoiceList.add(record.value, record.label); return glideChoiceList; }, '_getChoiceList': function () { return new GlideQuery('sys_choice') .where('name', 'x_1316384_tickets_tickets') .where('element', 'service_type') .where('language', this._sessionLanguage) .where('inactive', false) .where('dependent_value', 'CONTAINS', this._dependentValue) .limit(999) .orderBy('sequence') .select(['label', 'value']) .reduce(this._addRecordToChoice, new GlideChoiceList()); }, };
Save the record.
Open up the dictionary record for field "Service type"; switch view to Advanced, otherwise field Attributes will not be displayed:
Modify field Attributes by adding text:
choice_script=new Tickets().getSericeTypesForArea()
like this:
If there is some text in there already, place a comma between the existing and the new text.
E.g: if it already contains:
edge_encryption_enabled=true
like this:
the value for Attributes will become:
edge_encryption_enabled=true,choice_script=new Tickets().getSericeTypesForArea()
like this:
That's all there is to it.
Now for each choice for field "Service Type" you have to update field "Dependent value".
In case of "Service Type" choices that should only show for "Area" ti, the value in "Dependent value" should be ti (not ti,seg).
In case of "Service Type" choices that should only show for "Area" seg, the value in "Dependent value" should be seg (not ti,seg).
In case of "Service Type" choices that should show for both "Area" choices, the value in "Dependent value" should be ti,seg as is now.
Of course should you add more "Area" choices, you would just add it to the "Dependent value" as needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 07:27 AM
Go to configure dictionary of that field
Go to related list - Attribute
Add a new entry
Click new
and in value mention the field name not label.
do this step for 1 and test.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 09:18 AM
Was it supposed to stay like this? If it was, it didn't work, and I'm lost, I have no idea how to make a multiple reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 08:24 AM
Will come back with a step-by-step guide a bit later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 06:15 AM
it seems like your idea works
I wouldn't say it is my idea, it is a basic - though kept somewhat secret - functionality of the platform 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 07:09 AM