How do you copy a GlideRecord from one extended table to another extended table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2013 12:11 PM
Here is my situation: I am trying to copy all the contents of one GlideRecord from a custom table that is extended from task to a different custom table also extended from task. All the fields I'm interested in copying reside on the task table. I'm trying to do this in such a way as to not have to explicitly copy each field in code. The problem I'm encountering is that once I copy the current record to the new GlideRecord, it takes on the target table of the current record.
Business Rule Code example:
var gr = new GlideRecord('u_tfc_snapshot');
gr = current;
gr.insert();
The above doesn't work because even though I instantiate the gr variable against the custom extended table it is overwritten by the table targeted on the current record. There is a getTableName() function which returns the GlideRecord's table name, however I cannot find an equivalent setTableName('u_tfc_snapshot') function that I can use before Inserting the record.
Any Ideas?
Thanks!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2018 02:26 PM
Thanks!
How do you then redirect to the new record? in the UI action?