Jump to content

Dynamically Delete Rows


Recommended Posts

Hi,

 

I am almost did it :) Maybe, someone can help me with the last step.

 

Steps:

Create three DataPages:

  • Tabular DataPage that uses the table A as the DataSource;
  • Submission DataPage that uses the table B as the DataSource;
  • Details DataPage, that uses the table A as the DataSource.
  1. On Tabular DataPage, add the HTML Block, disable HTML Editor and enter the code:
    <a href="URL_where_Submission_DP_is_deployed?id=[@field:id]&name=[@field:name]&surname=[@field:surname]&comment=[@field:comment]">Delete</a>
    You can enter the correct URL and use as many fields as you want. The "Id" field is a field with unique value.
  2. On Submission DataPage,
    add Header and Footer element, disable HTML editor for Header and Footer, enter the following code to the Header:
    <div align="center"> <p>Processing...</p> <img src="images/progress_bar.gif" alt="Progress Bar" width="200" height="15" /> </div>
    And the following code to the Footer:
    <script type="text/javascript">
      if(document.getElementById("caspioform")) {
      document.getElementById("caspioform").style.display = 'none';
      setTimeout('document.forms["caspioform"].submit()',1000); }
    </script>

    Check for all fields "On load: Receive value or parameter" and select the "External parameter"
    Add a Virtual field, check for them "On load: Receive value or parameter", select the "External parameter" and the name of your Id parameter; check "On exit:Pass field value as parameter".
    On the Specify options to be performed after form submission screen, select "Go to a new page' and enter the URL of the page, where the third DataPage is deployed.

  3. On Details DataPage,
    in the "Do you need an interactive Search Form or pre-defined criteria?" screen, select "Filter data based on your pre-defined criteria";
    in the "Choose the fields you intend to use in filtering data" screen, add the "id" field to the Selected fields;
    in the "Configure the filtering criteria for each selected field" screen, on the Advacned tab, check "On load: Receive value or parameter", select the "External parameter" and the name of your Id parameter;
    in the next screen, add Header and Footer element, disable HTML editor for the Footer, enter the following code to the Footer:

    <script type="text/javascript">
      if(document.getElementById("caspioform")) {
      setTimeout('document.getElementById("Mod0DeleteRecord").click();',1000);}
    </script>

    in the next screen, check the "Delete record";
    in the next screen, in the "Destination after record delete" select "Go to a new page" and enter the URL of th first DataPage.

Now, when a user clicks the "Delete" link in the HTML blank, fields are copied to table B, and a user should confirm the deletion on the Details page. If the user confirms, the first DataPage opens.

 

I am sorry, if the solution is too complex.

Link to comment
Share on other sites

  • 3 years later...

Hi! Just an update. You can use Triggered Action on this specific workflow. 

Triggered Actions allows you to create and execute a specified data events (i.e. insert, update or delete) to perform additional data changes and complex data calculations on the same table and other tables.

You may refer to this article for more information: https://howto.caspio.com/tables-and-views/triggered-actions/ or watch this video:
 

I hope it helps!

Link to comment
Share on other sites

  • 3 months later...
On 11/24/2015 at 8:07 AM, crazedwombat said:

I'm not sure how to do this but my hope is

 

Table A has Item A and I want to delete it from Table A and add it into Table B but I'm not sure how to go about it, do I javascript/sql it or is there another way?

Hi @crazedwombat,

Just to update you on this, you can also use Tasks to move or copy Item A to Table B, then delete it in Table A. You just need to create separate Task for the copy of records and Task for delete. For more information, you may check on this link: https://howto.caspio.com/tasks/

 

-kristina

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
Reply to this topic...

×   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...