- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 10:24 AM
I have been working on several on-change client scripts to make this work, but have so far been unsuccessful. The task to make two fields that share the same table populate with their respective values, based-on the value of another field from the same table.
Below, is my script include.
How do I go about writing an on-change CS to make this work?
Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 03:41 PM
This is what I have defined in my PDI:
HHave added the fields to the Change Request form:
After flushing the cache, when I change System, Analyst and Owner automatically update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 02:29 PM
Yep, my code matches your example, with "System" being the onChange field name. Do Owner and Analyst need to be string fields, instead of reference fields? I have to add this is on the Change form on the platform view, not the portal. This is why I thought a script include was necessary.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2021 04:56 AM
Hi
No you dont need Script include even for Platform view.
Reference fields are also fine.
I feel the issue is you are not giving correct field names.
Can you please show me field names for your fields?
Right click on field it will show you logical name. For e.g Configuration item field logical name is 'cmdb_ci'. What is it for your fields in 'Change Request System Owners' and also on below form? Use them in script it should work.
Thank you
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2021 07:19 AM
Hi Prasad!
I am looking into your solution I think I have identified the issue.
In my custom table, System Owner is actually Product Owner, with a field name of "owner". On the Change Request table, this field is named "u_system_owner". Don't these two fields have to share a common name and if so, adding System Owner uses a 'u' prefix.
Otherwise, all other names are the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 02:32 PM
You can also accomplish this by using (System Policy -> Rules -> ) Data Lookup Definitions. No code needed. Also custom table will be "free".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 02:48 PM