Jump to content
  • 0

Add Button to Duplicate a record, deactivate the old record, and allow the User to edit the new record.


Hiperf

Question

I don't even know where to start with this one.

I have a Tabular Report that contains Lease Records for apartments. When these lease records expire, the Users need to be able to Click a Button that lease record row that will:

  1. Duplicate the 2023 Lease Record and create a 2024 Lease Record.
  2. Deactivate the old 2023 Lease Record ( I have a Yes/No field called Active ).
  3. Open the 2024 Lease Record in the Edit Record Data Page.

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello,

It might depend on your current tables setup but one possible solution could be to use a submission form to duplicate the record. Deactivating the old record could be done from the same report DataPage with the update option.
So what I would try to build is the following workflow:

1- Create a Submission Form that uses Parameters to create the new 2024 record.

2- Create an Update DataPage(if you don't have one already) which will be used for the step that you mentioned "Open the 2024 Lease Record in the Edit Record Data Page."

2- From your current Report DataPage, build a custom button that redirects the user to the Submission Form with the required parameters.
3-  In the Submission Form, choose the option to redirect the user to the Update DataPage passing the ID parameter so it loads the newly created 2024 record.

 

This is more or less what I would do but maybe it is not exactly what you are asking for but I hope it is a starting point for you. I would use the techniques in the following resources:

https://howto.caspio.com/parameters/parameters/
 

https://forums.caspio.com/topic/4314-js-auto-submit-a-datapage/

Link to comment
Share on other sites

  • 0

Hello @Hiperf,

In my opinion, the best option to duplicate the record is the Triggered Action.

The record status (Active/Inactive) can be changed by the Trigger too.

This solution can be helpful in displaying the 'Duplicate' button for only expired records https://howto.caspio.com/tech-tips-and-articles/disabling-inline-edit-option-in-reports-based-on-a-condition/

The standard 'Edit' link can be changed to 'Duplicate'. When the user clicks the link, the hidden checkbox is checked and the Trigger on update is executed.

 If you need assistance with this solution, I need to know more details: 

- Does the Tabular Report display all the records (expired and active)?

- What is the condition to consider the record to be expired?  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...