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 to 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 fixed matter fee arrangement is to be created.
@matterRecordId
The matter record's id value for which the fixed matter fee arrangement is to be created.
@contingencyPercentage
Your finalized contingency percentage offered to client.
@defaultForFees
To mark this matter fee arrangement as default when entering time for this matter.
@defaultForExpenses
To mark this matter fee arrangement as default when entering expenses for this matter.
@recurrence
Provide how often the client is to be charged for this 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 list of sObjects of matter fee arrangement type.
- 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