AdvoLogix Help

Adding or Updating an Accrual via Code

Updated on

The following global Apex method can be used to add or update an accrual.

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, '' );
Previous Article Retrieving an Accrual List via Code
Next Article Spend Management Data Model
Still need help? Click here!
AdvoLogix® is a registered trademark of AdvoLogix.com LLC a Texas Limited Liability Company. All references to other trademarks belonging to third parties that appear on this website, documentation, or other materials shall be understood to refer to those registered trademarks owned by others, and not to any trademark belonging to AdvoLogix. Otherwise, all material herein is the copyright of AdvoLogix.com LLC. All Rights Reserved.