A new custom callback class is supported to create Performance Obligations. 

It creates performance obligations for a set of Agreement Line Items and allocates revenue to it. For each performance obligation, it calculates Allocated Amount and Transaction Price.

To add the custom class

  1. Go to Setup > App Setup > Develop > Apex Classes.
  2. Click New.
  3. Enter the sample callback class code.


This is just a sample callback class to allocate performance obligations. You may change the code as per your requirements.


global interface IPerformanceObligationAllocation 
{
	/**
	 * Create the Performance Obligations for the specified list of Agreement
	 * Line Items. It is essential (and expected) the created Performance
	 * Obligations are also "inserted" into the database and the Transaction Price 
	 * and Allocated Amount fields of each Obligation are initialized to 0.
	 *
	 * After the Performance Obligations are returned the Revenue Configuration/Integration
	 * package will create/link the various Agreement Fees and compute (aggregate) and
	 * set the Transaction Price and Allocation Amount fields on the returned Obligations.
	 *
	 * @param agreementLineItms The list of Agreement Line Items to evaluate
	 *   and create the various performance Obligations for. 
	 * @param agreemnt The parent Agreement for the specified Agreement
	 *   Line Items. 
	 *
	 * @return the Performance Obligations that were created as a list of wrapper objects.
	 *   Each wrapper object will allow the Revenue Configuration/Integration package
	 *   (which calls the callbaclk) to correctly create the Agreement Fees and corrrectly
	 *   set the Transaction Price and Allocated Amount fields on the newly created Performance
	 *   Obligations. 
	 *
	 *   For the case of a Revenue Split Policy there will be a "map entry" for each Revenue 
	 *   Split Policy Entry (because a Performance Obligation is created for each entry). In addition,
	 *   each of the Performance Obligations will reference the same Agreement Line Item.
	 */
	List<PerformanceObligationInfo> createPerformanceObligations(
		List<Apttus__AgreementLineItem__c> agreementLineItms,
		Apttus__APTS_Agreement__c agreemnt);
}	
	
/**
 * Wrapper class used to return comprehensive information for each Performance Obligation
 * returned by the "create Performance Obligations" callback. The additional information
 * will allow the Revenue Configuration/Integration package (which calls the callback) 
 * to correctly create the Agreement Fees and correctly set the Transaction Price and
 * Allocated Amount fields on the newly created Performance Obligations. 
 */
global class PerformanceObligationInfo
{
	// The Performance Obligation created for 1 or more Agreement Line Items
	global Apttus__Obligation__c obligationSO;
	
	// The Agreement Line Items that pertain to the newly created Performance Obligation.
	// Typically there is only 1 Agreement Line Item but all Agreement Line Items (of an Agreement)
	// that have the same Revenue Merge Polcy will be grouped together.
	global List<Apttus__AgreementLineItem__c> agreementLineItems;
	
	// For the case where the Agreement Line Item has Revenue Split Policy this is Id of
	// Revenue Split Policy Entry that was applied to the newly created Performance Obligation,
	// otherwise this Id will be "null".
	global ID splitPolicyEntryId;
	global Id policyId;
	global Map<Id, Id> splitPolicyEntryIdbyLineItemId;
}
public class TestObligationAllocationCallback 
	implements CustomClass.IPerformanceObligationAllocation {
		
	public List<CustomClass.PerformanceObligationInfo> createPerformanceObligations(
			List<Apttus__AgreementLineItem__c> agreementLineItms,
			Apttus__APTS_Agreement__c agreemnt) {
				
		Apttus__Obligation__c obligationSO = new Apttus__Obligation__c();
		obligationSO.Apttus__AllocationAmount__c = 0;
		obligationSO.Apttus__TransactionPrice__c = 0;
		
		for(Apttus__AgreementLineItem__c agreementLineItemSO :agreementLineItms) {
			obligationSO.Apttus__AllocationAmount__c += agreementLineItemSO.AllocationAmount__c;
			obligationSO.Apttus__TransactionPrice__c += agreementLineItemSO.TransactionPrice__c;
			obligationSO.Apttus__StartDate__c = (obligationSO.Apttus__StartDate__c == null ||
												 obligationSO.Apttus__StartDate__c > agreementLineItemSO.Apttus_CMConfig__StartDate__c) 
												? agreementLineItemSO.Apttus_CMConfig__StartDate__c 
												: obligationSO.Apttus__StartDate__c;
			obligationSO.Apttus__EndDate__c = (obligationSO.Apttus__EndDate__c == null || 
												obligationSO.Apttus__EndDate__c < agreementLineItemSO.Apttus_CMConfig__EndDate__c) 
												? agreementLineItemSO.Apttus_CMConfig__EndDate__c 
												: obligationSO.Apttus__EndDate__c;
			
		}
		
		
		obligationSO.Apttus__RevRec_Rule__c = RevRecConstants.REVRECRULE_RATABLE;
		obligationSO.Apttus__Status__c = RevRecConstants.OBLIGATION_STATUS_ACTIVE;
		obligationSO.Apttus__Type__c = RevRecConstants.OBLIGATION_TYPE_PERFORMANCE;
		obligationSO.Apttus__Description__c = null;
		
		CustomClass.PerformanceObligationInfo performanceObligationInfoObj = new CustomClass.PerformanceObligationInfo();
		performanceObligationInfoObj.obligationSO = obligationSO;
		performanceObligationInfoObj.agreementLineItems = agreementLineItms;
		
		return new List<CustomClass.PerformanceObligationInfo> {performanceObligationInfoObj};
	
	}
}
CODE

4. Click Save.


To register your custom callback class, go to Setup > App Setup > Develop > Custom Settings and click Manage beside Revenue System Properties. Click Edit for System Properties and enter the name of your custom callback class in Performance Obligation Allocation Callback.

Refer to Revenue System Properties for more details.