Client Script (on change) - update current record??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2015 04:27 AM
Hi All,
Im currently doing some work to help the service desk diariise actions.
E.g.
If a customer requests a call back at a particular date and time regarding an incident.
I have added a 'next action due' date and time field which is on the incident form.
A onChange client script that when that field is populated a dialog box appears to allow them to put in what the action is (I created a new table for this).
When submitting that dialog form the system saves that record but then does the pop up for leave or stay on page since the next action due date on the incident form was not saved before the dialog window was loaded.
Is there anyway I can save the current incident record before loading the dialog? OR on the 'submit' UI action on the new table (where the dialog loads) have it save the incident record before submitting the new action to the db.
Any help appreciated.
- Labels:
-
Scripting and Coding
- 5,481 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2015 05:26 AM
You can place it onSubmit(). That might work better than onChange().
But the submit syntax in client scripts is: g_form.save() or g_form.submit(), I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2015 05:49 AM
Thanks Mike..the g_form.save() & g_form.submit() do work..however as the CS is trying to load the dialog at the same time as saving the current record it shuts the dialog. i.e. doesnt work as I want it to.
Thought about doing this on submit however I really want the service desk to be able to add what the next action is at the point they put the date in. It just feels like a better user experience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2015 06:08 AM
Maybe you put a timer on it.
window.setTimeout(<your window function>,1500);
function <your window function>(){
// your code
}