Feature/983 data importer

# Warning

# Info

The release includes the new NPSP Data Importer, which helps you easily import your data into the Nonprofit Starter Pack

# Issues

Fixes #983 
Fixes #1020 
Fixes #1015 
Fixes #1014 


Fine by me, and FWIW, just keep in mind that while you won't hit the list
limit, you would still hit the returned rows limit from the query itself.

On Tue, Sep 30, 2014 at 3:51 PM, David Habib <notifications@github.com>
wrote:

> In src/classes/BDI_DataImport_CTRL.cls:
>
> > +            return deleteImportedDIRecords();
> > +        } else if (strAction == 'deleteAll') {
> > +            return deleteAllDIRecords();	
> > +        }
> > +        // else we load up the DataImport page.
> > +        return null;
> > +    }
> > +
> > +    public PageReference deleteImportedDIRecords() {
> > +        for (list<DataImport__c> listDI : [select Id from DataImport__c where Status__c = 'Imported'])
> > +            delete listDI;
> > +        return (close());    	
> > +    }
> > +
> > +    public PageReference deleteAllDIRecords() {
> > +    	for (list<DataImport__c> listDI : [select Id from DataImport__c])
>
> From Apex documentation:
>
> SOQL For Loops
> Use SOQL for loops to operate on records in batches of 200. This helps
> avoid the heap size limit of 6 MB. Note that this limit is for code running
> synchronously and it is higher for asynchronous code execution.
>
> Example: Query without a for loop
>
> The following is an example of a SOQL query that retrieves all merchandise
> items and stores them in a List variable. If the returned merchandise items
> are large in size and a large number of them was returned, the heap size
> limit might be hit.
>
> List ml = [SELECT Id,Name FROM Merchandise__c];
> Recommended Alternative: Query within a for loop
>
> To prevent this from happening, this second version uses a SOQL for loop,
> which iterates over the returned results in batches of 200 records. This
> reduces the size of the ml list variable which now holds 200 items instead
> of all items in the query results, and gets recreated for every batch.
>
> for (List ml : [SELECT Id,Name FROM Merchandise__c]){
> // Do something.
> }
>
> DJH: So my read of this is that it would work in batches of 200, and thus
> not require a limit call on the soql, but it is true I may still hit a
> runtime error on the total number of DML calls I make. So I will go ahead
> and change it to just directly delete the first 10k. I do not think it is
> worth coding up batch support to delete all records if > 10k. let the user
> hit the button twice! agreed?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/SalesforceFoundation/Cumulus/pull/1067/files#r18242260>
> .
>



-- 
Kevin Bromer | Director of Product Development |  salesforcefoundation.org
| @kevinbromer