function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ghillerghiller 

ARCHIVING INVOICES WITH 0 BALANCES

We have a custom object called “Transactions” that is where we import all of our AR invoices (The sum of the invoices is what drives our actual revenue number).  We then export them daily using the data loader, change all outstanding balances to 0, re-import all of the invoices with the 0 balances, then override that data with that day’s outstanding balances.  The problem is, over time, the list of invoices will become too long to manage so I’d like to sort of “archive” all of the invoices with 0 balances in a separate area so they’ll still be in the system but not in the same location.  How should this be handled?  Should we create a new custom object for the Archived invoices?  Also I need help writing S-Control so that when an invoice balance turns to 0 the invoice will move to this new object. 
DevAngelDevAngel
Hi ghiller,

I think something critical is left out of your explanation.  Namely, how do you update the re-imported invoices with 0 balances with the day's outstanding balances?  This may be important in suggesting a better solution.
ghillerghiller
Actually the S-Control should be written for when the invoice fits two criteria, 1. The outanding balance is zero, and 2.  The invoice is over 90 days old, then it goes into archive.
DevAngelDevAngel
Again, need to know how the days updated balance get's applied.  I'm thinking trigger or workflow plus trigger to do this.
ghillerghiller
We export the daily balances from Quickbooks into an excel spreadsheet and import them into Salesforce using the data loader. 
NordbergNordberg
Hi ghiller,

Why do you want to move it to a new object?  Why not just change the record type of the current invoice to represent Archived.  You can then limit your views to only show non-archived invoices.  You could then build a workflow, field update that says, if the invoice is 90 days old and has a zero balance, then update the record type to Archive.

JD
ghillerghiller
We want to move them to a new object because the way it is set up currently is we have to export all invoices to excel, change all outstanding balances to 0, reimport all invoices with zero balances, then override those with the current outstanding balances from quickbooks.  We do this daily.  As of right now our export contains approximately 17000 lines, most of which are already zero balances.  To stop this list from growing, all old invoices with 0 balances I'd like to move to a different section, so they're still there but not a part of the daily export of data.
NordbergNordberg
You could use the record type, and just don't export any invoice record with a record type of Archive.  I am assuming that you are running at least professional in order to do this, but it isn't neccessary to move it to another object, just adjust your export parameters to not grab any Invoice in Archive record type.