- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2017 02:48 PM
Hi All,
I was asked to add subcategories to choose from that are dependent on the value of the CMDB_CI field. I was told this is not OOB functionality so I am looking for a decent work around.
To start, I created a choice field called "Application Subcategory" and I Made it dependent on the CMDB_CI Field value. First I chose just the field and got nothing. Then I chose CMDB_CI.Name and that made some values but not all and not the ones I wanted.
My idea is as follows. I will use a choice field to list the values (Business Services/App names). When a user selects the value on the choice list, I want to copy that value in to the CMDB_CI Field.
I'm not sure if this will work but hope it will and need a script to try it.
Can someone provide an "OnChange()" script.
Here's the pseudo script with correct field names.
"When "u_app_subcat_choice" changes from "None" and is not empty, set "CMDB_CI" to same as u_app_subcat_choice
I need this to happen on the form while being used in order to complete the record without having to save in between.
Any ideas or thoughts on this one?
Thanks
Carl
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 09:40 AM
I actually figured out a way to do this on my own!!!
As I mentioned, I am using a Reference fields as the Dependent Value. I added a bunch of choices to the dictionary and added the Application name as the Dependent value. It wasn't working.
So After this post and calling in an incident to support I was not getting where I hoped. I tried the following
From the incident form I right clicked on the label of my "Application Subcategory" and chose "Configure Choices"
Using the "Enter new item:" Field at the bottom of the form, I added the choices I wanted and saved.
This worked! and When I checked the dictionary, the Dependent Value was the Sys_ID of the Application I chose.
I don't see what could be wrong in this scenario but hope someone else may.
Thanks
Carl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2017 09:10 PM
Hi Carl,
From your question I assume that there are 3 fields available in your form. Category, Application Subcategory and Configuration Item (cmdb_ci).
- If your requirement is to make Application Subcategory dependable on Category then just chose Category in the Dependent field of Subcategory's dictionary.
- If you want Configuration item should be dependable on Application Subcategory and also should check that subcategory is dependent on category, then create a dictionary override for Configuration item field. Go to it's dictinary create new Dictionary overrides--> Select override reference qualifier-->and in the Reference qualifier write "javascript: "category="+current.u_category+"^subcategory="+current.u_application_subcategory;". In this qualifier we assume the field name of category is u_category and Subcategory name is u_application_subcategory.
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 06:39 AM
Thank you for your reply.
The Application Subcategory needs to be dependent on the Configuration Item. The Category is always "Applications" in this case.
I choose category = Applications, Then Enter the Configuration Item (Business Services Name) and then from there, there are Application Subcategories I need to set. There are different application subcategories for each application so the list is quite large without the dependency working.
Hope that clears it up a bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 07:22 AM
Hi Carl,
In the cmdb_ci table what is the relation with 'Application Subcategories' field? If that field is a static one, we can populate that with simple onChange script. Could you please provide a screenshot of any item (in cmdb_ci table) to clear the picture?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 08:04 AM
There is no relation on a CMDB_CI record to the Application Subcategory. The NAME is the value I am trying to use.
On the Application Subcategory field, I created it as a choice field. I then went to the Dictionary and created choices. I set the dependent field to "Affected Application or Device"(AKA CMDB_CI that was renamed) and I added the name of the application or business services in the Dependent Value.
Below is a screen shot.
1st you choose the "Category" which is Applications
Next you enter the Configuration Item or name of the application. (I want to use the CI field because then I can see more data about the Business Service than just the name so I am not using the Subcategory field )
Next you choose the "Application Subcategory" and it's supposed to show on the choices that have the Affected Application or Device name on the dependent value in the choice list.
Below is a screen shot of the form and beneath a screen shot of the dictionary showing the dependent value.
I think the value it wants is the Sys_ID instead of the name so I tried dotwalking to the cmdb_ci.name but that didn't help