Bulk delete bizform data

Charles Wesley asked on June 10, 2014 17:50

I see there is an article from Dec 2011 stating that bulk delete of biz forms is not possible without doing some coding.

My searches on devnet and Google don't turn up anything newer that suggests this has changed, but I wanted to double check to see if that is in fact the case.

For what it's worth the instance I'm working on in this particular case is v7, but I'd be happy to know for future reference if this behavior changed in v8 at all.

Recent Answers


Brenden Kehren answered on June 11, 2014 00:32 (last edited on December 10, 2019 02:30)

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
    }
|(identity)GlobalAdministrator%}

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.

0 votesVote for this answer Mark as a Correct answer

Charles Wesley answered on June 11, 2014 10:29 (last edited on June 11, 2014 10:29)

My issue is I need to delete a subset of records from within a biz form (in excess of 1,000 records) while retaining others (also in excess of 1,000). I am very easily able to isolate these records using the filter in the BizForm data tab (and export to CSV for archiving purposes).

Given that your solution is based on a custom query, is there any danger/reason why I shouldn't just run queries directly against the BizForm database tables to delete records?

Generally speaking I never like to do that--I'd prefer to use an API or otherwise "approved" method of using the app to change the state of the database. But if there are no external dependencies on these tables, given my use case, it sounds like a SQL script might be a viable option?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 12, 2014 14:03

It would be very simple to create a webpart to get the subset based on a filter and use the api to delete those results. I'd suggest doing that. This would be a more robust solution although require you to write code.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.