Copy Values from another Table into a Form without saving?

shawn_h
Tera Guru

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!)

find_real_file.png

16 REPLIES 16

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. 

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.

No log generated with the code as normal.

But when explicitly declared, the log captures the sys_id and table name.

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.

Spotted that straight away, still no luck! 😞