- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 12:26 PM
There is some out of box functionality for Project Management that until today has been driving some of our PMs nuts. There are two fields that update one anotehr if changed:
- Planned End Date
- Planned Duration
The issue is, if you update Planned Duration and go directly to the 'Update' button and click it - the field updates but the calculation (i.e. the onChange Client Script) doesn't trigger. It seems like if you do anything else after updating the field, there's no issue. The client script runs fine (you see the Planned End Date change).
Right now I'm thinking of having the Update button do some action of some kind before the 'save' to get around this. Is that plausible? What additional scripting in a UI Action would I need to do to send a 'TAB' keystroke or something?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 12:16 AM
I think there is difference between a changed database value and a changed value on a form object.
Unlike onLoad() and onSubmit() scripts, onChange() scripts apply to a particular widget on a form rather than to the form itself. They are fired when a particular value changes on-screen.
Because you submit (press the update button) before the object has registered the change it wont't see the change on the form but will register the change.
So I think the script should just be triggered also on submit.
Changing the function of the update button would probably not be the recommended solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 12:38 PM
That does seem a little strange. If manually pressing tab causes it to fire, I'm assuming just a change in focus to another control (other than the update button) may suffice.
Something to try: Identify another control by it's ID and use:
$('controlID').focus();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 12:42 PM
Would controlID just be another field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 12:48 PM
Yes, but you may need to right click and "inspect element" to find the ID.
I don't know of a way to get the field's html ID via g_form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 12:16 AM
I think there is difference between a changed database value and a changed value on a form object.
Unlike onLoad() and onSubmit() scripts, onChange() scripts apply to a particular widget on a form rather than to the form itself. They are fired when a particular value changes on-screen.
Because you submit (press the update button) before the object has registered the change it wont't see the change on the form but will register the change.
So I think the script should just be triggered also on submit.
Changing the function of the update button would probably not be the recommended solution.