
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2015 11:47 AM
Hello,
I have a couple onChange Client Scripts that set two reference values based on other choices on the Incident form. When a new Incident form is loaded, making changes to the Type, Subtype, and Category boxes will auto-populate our Business Service and Technical Service reference fields.
Here is a screen shot of the top half of our Incident form when creating new:
As you see here, I have made changes to the Type, Subtype, Category fields and the Business/Technical Service was filled in by our Client Script:
If I change any of the values already selected on the left side of the form, the right side is set to blank and waits for proper values. As long as this is a new record, this Client Script works without issue. However, once saved, it stops working. I can change the left side of the form, but nothing on the right changes as it's supposed to:
The Business Service for the above example should have been changed to: Shared Services - IT Software
The Technical Service for the above example should have been changed to: DB Hosting - Oracle
Is there something that I'm missing to have a Client Script work after a form is no longer a New Record?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2015 07:34 AM
After many hours looking into this and trying to find the reason it wasn't working, a solution has been found! An onLoad script that set the cursor focus for the Incident Table was throwing an error when "isNewRecord" returned false. It appears a field we put on the Incident Table a few months ago was removed. That onLoad script was supposed to select that field. It's now set to focus on Short Description and all of the above onLoad/onChange code works just fine.
Thank you to everyone that put in the time to debug with me. This is the reason I enjoy being a part of this community.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2015 12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2015 03:46 PM
Chris,
can you do one thing,add some log on second client script.
and after 18 row clear the existing u_business_service && u_technical_services values.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 11:13 AM
I get an error message stating that gs.log doesn't work in a client script and to use Alert instead. So, I added alert info and it shows me exactly what I want it to, so long as the Incident is a new one. After saving it, the Alerts no longer appear.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2015 07:35 AM
Is there any dependencies between the 3 fields?
If just the type changes, nothing will happen. But if Type changes, and it clears the other 2 fields, these scripts won't run either.
When SubType script runs, it clear Category, which makes me think they are dependent on each other.
So if you just change Subtype, what happens?
If you just change category, what happens?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 11:14 AM
Type is a standalone Choice field. Subtype is a Choice field, and is dependent on Type. Category is a Choice field and is dependent on Subtype. When the Incident is a new one, everything works. After saving the Incident, nothing happens.