Copy functionality in Grails application

Following is easy code you can implement a Grails application to implement copy functionality:-


The primary key is passed as a parameter to the create action which effectively creates a blank template and fills up with existing record

<td><g:link action="create" params="${processParamAssignInstance.getPK()}">Copy</g:link></td>

Domain class

Here defPK contains all the variables which make up the composite key of the domain class

def getPK(){

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s