Copy Values from another Table into a Form without saving?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 02:09 AM
Hi folks,
Hope you can help!
I'm looking for a way to copy field entries I have in a custom table into an incident form, but ideally I'd want to be able to copy the entries and not save them/create a record, more so they appear within the fields and the user has the option to save/edit them before continuing.
I currently have an extra referenced field linking to my custom table, and a UI action that pulls in those fields. The downside is I've done this wrong as it saves and creates the record also.
Essentially i'm looking for a way of emulating the functionality of templates, but cannot actually use templates for this purpose (unless it's possible to link templates into this other table, and call them that way, but I'd prefer another solution if there is one!)
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 05:12 AM
Nothing happens with an alert on the Script Include.
Alerting on UI action returns "null"
If i alert on UI action having explicitly declared the table name and sys_id in the script include, i get the comma separated values of the fields in the alert.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 05:26 AM
Now put gs.log(table); and gs.log(sys_id) after these lines
var table = this.getParameter(sysparm_table);
var sys_id = this.getParameter(sysparm_sys_id);
in the script include and check for logs. Its somewhere here i guess the problem is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 05:36 AM
No log generated with the code as normal.
But when explicitly declared, the log captures the sys_id and table name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 05:57 AM
ga.addParam("sysparm_sys_id", g_form.getVaue("name of reference field comes here"));
did you happen to correct this.?
ga.addParam("sysparm_sys_id", g_form.getValue("name of reference field comes here"));
If not, now the code will work like never before :D.
Please mark as correct answer if this solves the issue or we can further diagnose it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2018 06:03 AM
Spotted that straight away, still no luck! 😞