BankDeposit Class

Contains methods for adding, removing, and retrieving source documents associated a bank deposit.

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

BankDeposit Methods

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


associate(Id bankDepositId, List<Id> itemIds)

Associates source documents with a bank deposit. The items can only be of type Cash Receipt or Journal Entry Line. A maximum of 200 items are allowed per associate method invocation.

Return Value
Type: ServiceResult

Usage

AcctSeed__Bank_Deposit__c bankDeposit = [Select Id FROM AcctSeed__Bank_Deposit__c LIMIT 1];
AcctSeed__Cash_Receipt__c cashReceipt = [Select Id FROM AcctSeed__Cash_Receipt__c WHERE AcctSeed__Bank_Deposit__c = NULL LIMIT 1];
List<Id> itemIds = new List<Id>();
itemIds.add(cashReceipt.Id);
AcctSeed.ServiceResult sr = AcctSeed.BankDeposit.associate(bankDeposit.Id, itemIds);



retrieve(Id bankDepositId)

Retrieves the source documents associated with a bank deposit.

Return Value
Type: BankDepositModel

Usage

AcctSeed__Bank_Deposit__c bankDeposit = [Select Id FROM AcctSeed__Bank_Deposit__c LIMIT 1];
AcctSeed.BankDepositModel model = AcctSeed.BankDeposit.retrieve(bankDeposit.Id);



unassociate(Id bankDepositId, List<Id> itemIds)

Unassociates source documents with a bank deposit. The items can only be of type Cash Receipt or Journal Entry Line. A maximum of 200 items are allowed per associate method invocation.

Return Value
Type: ServiceResult

Usage

AcctSeed__Bank_Deposit__c bankDeposit = [Select Id FROM AcctSeed__Bank_Deposit__c LIMIT 1];
AcctSeed__Cash_Receipt__c cashReceipt = [Select Id FROM AcctSeed__Cash_Receipt__c WHERE AcctSeed__Bank_Deposit__c = NULL LIMIT 1];
List<Id> itemIds = new List<Id>();
itemIds.add(cashReceipt.Id);
AcctSeed.ServiceResult sr = AcctSeed.BankDeposit.unassociate(bankDeposit.Id, itemIds);



BankDeposit Method Error Codes

Error Code Error Detail Applicable Methods
NO_INPUT_DATA No data provided to complete the request. associate, retrieve, unassociate
INVALID_RECORD_OR_ID Missing or invalid record or id provided. associate, retrieve, unassociate
NO_BANK_DEPOSIT_ITEMS Missing Bank Deposit Item records. associate, unassociate
INVALID_ASSOCIATION_RECORD Invalid record to associate * associate
INVALID_UNASSOCIATION_RECORD Invalid record to unassociate † unassociate
OVER_BANK_DEPOSIT_ITEM_LIMIT Number of item records above limit of 200 associate, unassociate

* The record or parent record must be posted. The record must not be associated with a Bank Deposit or Bank Reconciliation. The record must be the same bank account as the Bank Deposit. The record GL Variables must be the same value as the Bank Deposit.
The record is not associated with this Bank Deposit or the associated Bank Deposit is associated with a Bank Reconciliation.