1
0
-1

Hi, Im using Duplicate Data Plugin. But it duplicate all data including previous running number value.

How can i use the duplicate data plugin but avoid to duplicate the running number column? The running number should running by id generator. But when i using duplicate data Plugin the id generator not functioning.

I have tried used below script before, but this script not function to duplicate attachment documents and files.

import org.joget.apps.form.model.Form;
import org.joget.apps.form.model.Element;
import org.joget.apps.form.model.FormData;
import org.joget.apps.form.model.FormRow;
import org.joget.apps.form.model.FormRowSet;
import org.joget.commons.util.LogUtil;
import org.joget.apps.form.lib.WorkflowFormBinder;

public FormRowSet loadData() {
FormRowSet rows = null;

WorkflowFormBinder binder = new WorkflowFormBinder();

String duplicateId = "#requestParam.duplicate_id#";
if (!duplicateId.isEmpty() && !duplicateId.contains("requestParam.")) {
rows = binder.load(element, duplicateId, formData);
FormRow row = rows.get(0);
row.setId(null);
row.remove("running_number");
} else {
rows = binder.load(element, primaryKey, formData);
}

return rows;
}

return loadData();


Hope you can help me.

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      HI Jogetuser,

      mind sharing your solution? I'm having same issue

        CommentAdd your comment...
      1.  
        1
        0
        -1

        I already solved this issue. Thanks.


        Btw, this is duplicate data plugin.


          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi, what is this Duplicate Data Plugin that you are referring to, I don't see it in my installation. Do you have a sample app to demonstrate the problem?

            CommentAdd your comment...