AdvoLogix Help

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

Updated on

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

Syntax:

FeeArrangementService.createContingencyFeeMatterFeeArrangement(
   @feeArrangementRecordId,
   @matterRecordId,
   @contingencyPercentage,
   @defaultForFees,
   @defaultForExpenses
);

Parameters:

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

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

@contingencyPercentage
Your finalized contingency percentage 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 is to 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 of 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.createContingencyFeeMatterFeeArrangement(
  'a0A9000000RJhKTE',
  'a05900000051CpN',
  35,
  false,
  false
);
System.debug('Matter Fee Arrangement created : ' + result.Name);
Previous Article How do I create a fixed fee matter fee arrangement for a matter via code?
Next Article How do I retrieve a list of matter fee arrangements via automation?
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.