Nav view search



The Exchange

The place to download pre-configured tickets, code snippets, and solutions


Copy Records in Virtual Ticket with MetaScript

Use MetaScript to copy folder and document type records in Virtual Ticket.

Note: This solution is optimized for Virtual Ticket Developer.

If you are using Workgroups DaVinci and are planning to use a Toolbox snippet not marked as DaVinci-compatible, please check with Support for possible compatibility issues before using.


Sometimes a record for a folder or document type may need to be duplicated wholly or in part to create a new record. For example, a job may be repeated from month to month with just adjustments in the dates associated with the job. In these cases, a copy operation on a form under the folder or document type can save time and reduce the chances of user error introduced by rekeying data.

Any record can be copied via MetaScript using the CopyTicket function found in copy_ticket.js:


CopyTicket (<data_type>, <source_id>, <target_id>, <include_documents>, <fields_to_exclude>, <documents_to_exclude>, <fields_to_set>);

  • <data_type>
  • <source_id>
  • <target_id>
  • <include_documents>
  • <fields_to_exclude>
  • <documents_to_exclude>
  • <fields_to_set>

CopyTicket returns an object with the value of the identifying field in the new record that was created.


var new_job = CopyTicket('Jobs', 1, null, true, [ "Due_Date", "Ship_Date"], [ "Changes" ], { "Entry_Date" : ServerDate(), "Status" : "Pending" } ;    

To use the example: 

  1. Download the form library.
  2. Import the form and scripts into Virtual Ticket.
  3. Create a new record with the form. Click the duplicate button to have the record duplicated. The Go button can be clicked to view the duplicated record.

Note: Field names used in the script above are case-sensitive. 


  • Download and install a sample form illustrating this Toolbox Snippet (see below).

Last Modified:



Justin Bierman