The following global Apex method can be used to add or update an accrual.
Syntax:
AccrualsService.addOrUpdateAccrual(
@vendorRecordId,
@matterIdOdNumber,
@month,
@year,
@amount,
@accrualRecordId
);
Parameters:
@vendorRecordId
The record identifier of the Vendor record.
@matterIdOrNumber
The Matter Number or the record identifier of the Matter record.
@month
The 3-character reference to month name.
(Must be restricted to following value set [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec])
@year
The 4-digit year value as a string.
@amount
The amount for your accrual greater than 0.
@accrualRecordId
Optional. The record identifier. of the Accrual record to be updated.
Result:
The function call will return an object of type: advspm__Accrual__c.
Example:
List<advspm__Accrual__c> accrList = AccrualsService.addOrUpdateAccrual( 'a059000000RJhKTEAA', 'b126000000ghrEAABA', 'Jan', '2023', 5000, '' ); OR List<advspm__Accrual__c> accrList = AccrualsService.addOrUpdateAccrual( 'a059000000RJhKTEAA', 'MAT-LK-2023', 'Mar', '2023', 2500, '' );