BankReconciliation Class

Contains methods for adding, removing, and retrieving source documents from a bank reconciliation.

Note: This class and methods cannot be used in a trigger context.

BankReconciliation Methods

The following are methods for BankReconciliation. All methods are static.


clear(Id bankReconciliationId, List<Id> itemIds)

Clears and associates source documents with a bank reconciliation. By default the cleared date is set to today's date. The items can only be of type Cash Receipt, Journal Entry Line, Cash Disbursement, or Bank Deposit. A maximum of 200 items are allowed per clear method invocation.

Return Value
Type: ServiceResult

Usage

AcctSeed__Bank_Reconciliation2__c bankRec = [Select Id FROM AcctSeed__Bank_Reconciliation2__c LIMIT 1];
AcctSeed__Cash_Receipt__c cashReceipt = [Select Id FROM AcctSeed__Cash_Receipt__c WHERE AcctSeed__Bank_Reconciliation__c = NULL LIMIT 1];
List<Id> itemIds = new List<Id>();
itemIds.add(cashReceipt.Id);
AcctSeed.ServiceResult sr = AcctSeed.BankReconciliation.associate(bankRec.Id, itemIds);



clear(Id bankReconciliationId, List<Id> itemIds, Map<Id, Date> itemToClearedDate)

Clears and associates source documents with a bank reconciliation. Includes the option to map a cleared date to an item Id to clear. The items can only be of type Cash Receipt, Journal Entry Line, Cash Disbursement, or Bank Deposit. A maximum of 200 items are allowed per clear method invocation.

Return Value
Type: ServiceResult

Usage

AcctSeed__Bank_Reconciliation2__c bankRec = [Select Id FROM AcctSeed__Bank_Reconciliation2__c LIMIT 1];
AcctSeed__Cash_Receipt__c cashReceipt = [Select Id FROM AcctSeed__Cash_Receipt__c WHERE AcctSeed__Bank_Reconciliation__c = NULL LIMIT 1];
List<Id> itemIds = new List<Id>();
Map<Id, Date> itemToClearedDate = new Map<Id, Date>();
itemIds.add(cashReceipt.Id);
itemToClearedDate.put(cashReceipt.Id, Date.newInstance(2019,2,2));
AcctSeed.ServiceResult sr = AcctSeed.BankReconciliation.associate(bankRec.Id, itemIds, itemToClearedDate);



retrieve(Id bankReconciliationId)

Retrieves the source documents associated with a bank reconciliation.

Return Value
Type: BankReconciliationModel

Usage

AcctSeed__Bank_Reconciliation2__c bankRec = [Select Id FROM AcctSeed__Bank_Reconciliation2__c LIMIT 1];
AcctSeed.ServiceResult sr = AcctSeed.BankDeposit.retrieve(bankRec.Id);



unclear(Id bankReconciliationId, List<Id> itemIds)

Unclear source documents associated with a bank reconciliation. The items can only be of type Cash Receipt, Cash Disbursement, Bank Deposit, or Journal Entry Line. A maximum of 200 items are allowed per unclear method invocation.

Return Value
Type: ServiceResult

Usage

List<AcctSeed__GL_Account__c> glAccounts = [SELECT Id FROM AcctSeed__GL_Account__c WHERE AcctSeed__Bank__c = TRUE LIMIT 1];
AcctSeed__Cash_Receipt__c cashReceipt = new AcctSeed__Cash_Receipt__c();

AcctSeed.ServiceResult sr = AcctSeed.BankDeposit.unclear(Id bankReconciliationId, List<Id> itemIds);



BankReconciliation Method Error Codes

Error Code Error Detail Applicable Methods
NO_INPUT_DATA No data provided to complete the request. clear, retrieve, unclear
INVALID_RECORD_OR_ID Missing or invalid record or id provided. clear, retrieve, unclear
INVALID_CLEAR_RECORD Invalid record to clear * clear
INVALID_UNCLEAR_RECORD Invalid record to unclear † unclear
NO_RECONCILIATION_ITEMS Number of item records above limit of 200 clear, unclear

* The record must be posted. The record or parent record must not be associated with another Bank Reconciliation. The record must not be associated with a Bank Deposit. The record must be associated with the same bank account as the Bank Reconciliation. The record must have the same GL Variable values as the Bank Reconciliation.
The record is not cleared with this Bank Reconciliation.