Fixed Asset Management

fam.DepreciationCalculation

global abstract with sharing class DepreciationCalculation

This class must be extended by the customer if the customer is writing their own implementations of the fam.DepreciationCalculation class.

This class contains deprecated items.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

Methods

generateSchedules

global virtual List<fam__FA_Depreciation_Schedule__c> generateSchedules(fam__Depreciation_Book__c book, Decimal totalAmountToDepreciate, Date depreciationStartDate)

This method is employed by the GenerateScheduleService to generate partial periods of the Depreciation Book.

Input Parameters

Name Type Description
book fam__Depreciation_Book__c An instance of Depreciation_Book__c object
totalAmountToDepreciate Decimal The Total Amount to Depreciate
depreciationStartDate Date The Depreciation Start Date
depreciationStartDate Date The Depreciation Start Date

updateBefore

global virtual void updateBefore(fam__FA_Depreciation_Schedule__c[] oldSchedules, fam__FA_Depreciation_Schedule__c[] updatedSchedules, Map<Id, fam__FA_Depreciation_Schedule__c> scheduleMap)

This method is called before updating the schedules and performs schedule validation

Input Parameters

Name Type Description
oldSchedules fam__FA_Depreciation_Schedule__c[] List of Schedules on the Database
updatedSchedules fam__FA_Depreciation_Schedule__c[] List of Updated schedules
scheduleMap Map<Id, fam__FA_Depreciation_Schedule__c> Map with IDs and Depreciation Schedules

updateAfter

global virtual void updateAfter(fam__FA_Depreciation_Schedule__c[] oldSchedules, fam__FA_Depreciation_Schedule__c[] updatedSchedules, Map<Id, fam__FA_Depreciation_Schedule__c> scheduleMap)

This method is called after updating a schedule and performs schedule validation

Input Parameters

Name Type Description
oldSchedules fam__FA_Depreciation_Schedule__c[] List of Schedules on the Database
updatedSchedules fam__FA_Depreciation_Schedule__c[] List of Updated schedules
scheduleMap Map<Id, fam__FA_Depreciation_Schedule__c> Map with IDs and Depreciation Schedules

validateBook

global virtual void validateBook(fam__Depreciation_Book__c book)

You can override this method to provide some calculation specific validation. For example: • Sum of Years Digits requires that the Service Life is an Integer. • Units of Production requires that the Service Life in Units field is provided.
If validation fails, then an exception should be thrown. Any exceptions thrown by this method are caught and returned to the user in a controlled manner.

Input Parameters

Name Type Description
book fam__Depreciation_Book__c A Queried Depreciation Book including fields added via an implementation of DepreciationBookQueryFields

Deprecated

The following items are deprecated and not supported for use. We recommend that you stop using these items to avoid exceptions.

Methods

generate

Deprecated: This method has been superseded by generateSchedules, but you must still implement it.

global abstract void generate(Id[] bookIds)

Input Parameters

Name Type Description
bookIds Id[] A list of Depreciation Book IDs
© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.