The following global Apex method can be used to retrieve list of accruals by providing vendor or matter.
Syntax:
AccrualsService.getAccrualsList(
@vendorRecordId,
@matterIdOrNumber,
@fields,
@orderBy
);
Parameters:
@vendorRecordId
The record identifier of the Vendor record.
@matterIdOrNumber
The Matter Number or the record identifier of the Matter record.
@fields
Optional. The comma-separated list of fields that would be returned for the accrual records.
(If left empty, then the result will include all fields from Accruals)
@orderBy
Optional. A SOQL compliant order by phrase using which you can get list of Accruals sorted by a specific column from Accruals.
For example, advspm__Start_Date__c ASC
would return list of accruals in ascending order of Start Date.
(If left empty, then the result will be sorted by Created Date in ascending order)
Either @vendorRecordId
or @matterIdOrNumber
must be provided for this API method.
Result:
The function call will return an object of type: List<advspm__Accrual__c>. This object will have fields based on the input parameters.
Example:
List<advspm__Accrual__c> accrList = AccrualsService.getAccrualsList( 'a059000000RJhKTEAA', 'b126000000ghrEAABA' ); OR List<advspm__Accrual__c> accrList = AccrualsService.getAccrualsList( 'a059000000RJhKTEAA', 'MAT-LK-2023' );