Forum

Thread tagged as: Question, Api, Add-on-development

Creating Duplicate Function

Hi Drew,

Currently in the planning stages for a custom app for a large events venue, one of the features that would help them out would be the ability to duplicate items within the app. My main concern is whether this would be possible when using the tableDynamicFields content, especially with uploaded assets.

The obvious way is to simple copy the row data to a new one, but are there references and internal resource tracking IDs that would be broken by this method? If this is an issue would there be an alternative? I know this has been requested for the core perch content app and you've said it isn't as simple as it seems on that.

James Wigger

James Wigger 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you duplicating the resources too?

I don't believe so - the theorised workflow for the client would be:

  1. Find the event they want repeating
  2. Click duplicate and it creates an identical event, the client is directed to the new event's edit form
  3. They edit as they would normally - they might put new images / files or they might leave the ones from the previous event and only update the text fields.
Drew McLellan

Drew McLellan 2638 points
Perch Support

The danger if you don't duplicate the logs is that the older version will be deleted and they'll be no record of the newer version still using the resources.

Generally it's ok for a resource to be completely logged or completely no logged. Part logged is the danger zone.

Ah, that makes sense. Ok I'll build in full resource log duplications once the app gets to that stage. Thanks for your help!