Charles Wesley
Charles Wesley

Reputation: 829

Bulk delete BizForm data

I need to delete a subset of BizForm data (in excess of 1,000 records).

I see there is a DevNet article from Dec 2011 stating that bulk delete of biz forms is not possible without doing some coding. This is a problem for me because any coding that I would do would require a code release to production, which would take too long.

In an answer to my original DevNet post, an interesting solution was proposed:

There are alternatives...

Create a new doc type, that is a placeholder and does not contain any data. Create a custom query to simply "TRUNCATE

". Place a query repeater webpart on a page. ** VERY IMPORTANT ** Set the visibility = false (uncheck box) first so the query doesn't run. Next select the query you just created. Add another webpart (editable text) to the page. Make it a link to the same page with a URL parameter at the end, say /my-page/?isdelete=1.

Now go back to the previous webpart (query repeater) and set a macro on the visibility property. Use this macro:

{% if (QueryString.GetValue("isdelete") == "1") { return true; // run the code } else { return false; // don't run code } %}

This should get what you're looking for without any kind of code behind writing. You might want to ensure there is some kind of security on that page.

It seems like just writing a custom SQL query and putting it into a query repeater webpart and then executing that is a possible solution.

However, if that's the case, is there any reason why I shouldn't execute a SQL script directly against the database targeting the BizForm tables I'm interested in?

Are there any dependencies or integrity issues that might result from this approach?

Upvotes: 0

Views: 155

Answers (1)

Raymond A
Raymond A

Reputation: 793

from my experiences with Bizform , executing the truncation on the database has been the fastest way of emptying bizform tables. Before running the script against the database make sure of the following:

  • No foreign key constraints exist with other related table.
  • No Custom form controls relies on the information found in the Bizform.
  • You have exported the data to flat files for archiving.
  • You have a backup of the Database ready to be rolled-back should anything goes wrong.

And the truncate or delete the excess data.

Upvotes: 1

Related Questions