Custom duplicate entries for Custom Javascript workflow

I am trying to create a custom action button that will duplicate an entire entry except for the Revision field and increase the value of that field by one.

I managed to code for the increase in revision value. However, I’m not sure what function to use to duplicate the rest of the entries.

I tried using the db.entryCopier function but it returns a no record found error. I am assuming it doesn’t work if the table path is the same?

Or do I have to use the insertAPIEntry()? If so, how do I populate the new Entry with the previous fields data?

Thank you.

Hi,

Do you have the sheet URL with the script that we can look thru?

https://ap5.ragic.com/bhlee/sales/1#!/1

Hey,

We don’t recommend you to do this with the script.

You can do it with this:
https://www.ragic.com/intl/en/doc/73/Convert-records-button
you can just convert the record to the same sheet.

One more thing is you can create a hidden field with the formula to do the add one thing:
https://www.ragic.com/intl/en/doc/18/Formulas#operators

Then convert the hidden field value to the original Revision field.

Ah okay, I wasn’t sure if convert records could do this.

May I ask how do I use the hidden field with the formula to increase the value automatically upon each new revision? Can I use “Update values” to increase the value of the hidden field by 1?

Hi,

There would be two field, let’s say A1 and A2, assigned formula A1+1 to field A2.
Convert records to the same sheet, all the fields are convert to same fields except for A1 and A2.
Just convet A2 to A1, for instance, the original version A1 should be 0, A2 would be 1.
Convert the first time, A1 would be 1, A2 would be 1+1=2 on new entry.

Hi Hank, thanks for the quick reply. I’ve managed to figure this out as well.

1 Like