After submitting Incident, Client Script stops working

cwmurphy
Mega Expert

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:

find_real_file.png

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:

find_real_file.png

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:

find_real_file.png

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?

1 ACCEPTED SOLUTION

cwmurphy
Mega Expert

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.


View solution in original post

15 REPLIES 15

cwmurphy
Mega Expert

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.