AdvoLogix Help

How do I create a fixed fee matter fee arrangement for a matter via code?

Updated on

The following Apex method can be used to create a fixed fee matter fee arrangement for a matter via custom coding. Please be aware that you are always advised to test your code in the sandbox.

Syntax:

FeeArrangementService.createFixedFeeMatterFeeArrangement(
   @feeArrangementRecordId,
   @matterRecordId,
   @matterPrice,
   @defaultForFees,
   @defaultForExpenses,
   @recurrence,
   @startDate,
   @endDate
);

Parameters:

@feeArrangementRecordId
The fee arrangement record's id value using which the fixed fee type of matter fee arrangement is to be created.

@matterRecordId
The matter record's id value for which the fixed fee type of matter fee arrangement is to be created.

@matterPrice
Your finalized matter price offered to client.

@defaultForFees
To mark this matter fee arrangement as the default when entering time for this matter.

@defaultForExpenses
To mark this matter fee arrangement as the default when entering expenses for this matter.

@recurrence
Provide how often the client will be charged for these fees.
(Accepted values are: One Time, Monthly, Quarterly, Annually)

@startDate
If your recurrence is other than One Time, then provide the start date for it.

@endDate
If your recurrence is other than One Time, then provide the end date for it.

Result:

The function will return a list of sObjects for the matter fee arrangement type.

Fields Returned in the Output:
  • RecordTypeId
  • RecordType.DeveloperName
  • Name
  • advpm__Description__c
  • advpm__Source_Fee_Arrangement__c
  • advpm__Matter__c
  • advpm__Matter_Price__c
  • advpm__Discount_Percentage__c
  • advpm__Contingency_Percentage__c
  • advpm__Fee_Arrangement_Price__c
  • advpm__Total_Unit_Caps__c
  • advpm__Recurrence__c
  • advpm__Default_for_Fees__c
  • advpm__Default_for_Expenses__c
  • advpm__Start_Date__c
  • advpm__End_Date__c
  • advpm__Transactions_Billed_To_Date__c
  • advpm__Transactions_To_Be_Billed__c
  • advpm__Total_Price__c
  • advpm__Total_Cost_as_Priced__c
  • advpm__As_Priced_Profit_Margin__c
  • advpm__Total_Cost_for_Expenses__c
  • advpm__Total_Cost_for_Time__c
  • advpm__Total_Cost_as_Delivered__c
  • advpm__As_Delivered_Profit_Margin__c
  • advpm__NextBillDate__c
  • advpm__LastBillDate__c
  • CreatedDate
  • LastModifiedDate
  • CreatedById
  • LastModifiedById
  • OwnerId

Example:

advpm__Matter_Fee_Arrangement__c result = FeeArrangementService.createFixedFeeMatterFeeArrangement(
  'a0A9000000RJhKTE',
  'a05900000051CpN',
  2000,
  true,
  false,
  'Monthly',
  Date.valueOf('2023-01-01'),
  Date.valueOf('2023-10-31')
);
System.debug('Matter Fee Arrangement created : ' + result.Name);
Previous Article Retrieve a Matter Fee Arrangements via Code
Next Article How do I create a contingency fee matter fee arrangement for a matter via code?
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.