Copy Record
What it does
This Add-In makes a new Record from the one that is open, clears the fields that should not carry over, and opens the new Record so the user can finish it. Use it for repeat orders, recurring requests, or any Record that is usually a small change from an earlier one.
Settings
- Create a new Add-In and name it something like Copy Order.
- Under General Settings, set Type to Full Screen Web Site. This type runs the Add-In's actions first and then opens a web address, which is how the Add-In opens the new Record when it finishes.
- Set Web URL to [URL]record/[RecordID] and Target Window to _self. [URL] is your DocMgt address, and [RecordID] is filled in after the actions run, so it is the ID of the new Record. With Target Window left blank, the new Record opens in a new browser tab instead.
- Under Where/When to Show, turn on the Record location, and use Record Types to limit it to the Record Types it was built for.
- Under Confirmation Prompt, add a short message such as "Create a new order from this one?"
Actions
Add a Copy Record action under Record Actions.
- Leave Record ID to Copy blank to copy the open Record.
- Under Additional Record Fields, add a row for each field that should not carry over to the new Record, with [DEL] as the New Value so the field is left off the copy. Typical examples are an order number, a status, approval fields, or dates. You can also set a starting value instead, such as Status set to New or OrderDate set to [DATE]. These changes are made to the copy before it is saved, and the original Record is not changed.
- Turn Switch Context on. The new Record then becomes the Active Record for the rest of the Add-In, which is what makes [RecordID] in the Web URL point to it.
- Turn Routing on if the new Record should start its workflow straight away.
Using it
Open the Record to copy and click Copy Order. Confirm the prompt. The new Record is created and opens in place of the original, ready to finish.
Notes
- The copy gets every field of the original, including line items, and ends up with the same Record Type. Documents, Record notes, and workflow history are not copied.
- Clear or change any field that must be unique in the Record Type under Additional Record Fields. If the copy keeps the same value, it cannot be saved and the Add-In stops with a duplicate error.
- If the Record Type matches new Records to existing ones by certain fields, change at least one of those fields under Additional Record Fields. Otherwise the copy matches the original and is saved onto it instead of becoming a new Record.
- Additional Record Fields changes one line at a time. To clear a field on every line item, add a Record Multi-Value Update action after the Copy Record action, with [DEL] as the Field Value and -1 as the Line Number. Because Switch Context is on, it changes the new Record.
- The copy is made from the Record as it was last saved. Save any changes to the original before clicking the Add-In.
- To keep a link from the original to its copy, enter a field name in Record ID to Field. The new Record's ID is written to that field on the original Record.