Lifecycle Callback Class
Lifecycle Callback provides you a mechanism to execute custom actions at the following stages in the quote process. class
- after a proposal is cloned
- after an agreement is created from a proposal
- creates a new proposal from the given account
- creates a new proposal from the given opportunity
- clones the given proposal
- creates a new agreement from the given proposal
- after a proposal is created from an account
- after a proposal is created from an opportunity
To use the Lifecycle Callback you must create a custom Apex class that implements the Apttus_Proposal.CustomClass.IQuoteLifecycleCallback2 interface and register the custom apex class with Lifecycle Callback Class. You must write your custom logic in the custom apex class.
You must register the custom apex class for this callback in Lifecycle Callback Class in Proposal Custom Classes instead of Config Custom Classes.
The following methods are available in the Apttus_Proposal.CustomClass.IQuoteLifecycleCallback2interface:
Method | Signature | Description |
---|---|---|
afterClone() | void afterClone(Apttus_Proposal__Proposal__c, Apttus_Proposal__Proposal__c) | You can use this method to execute custom logic after the proposal is cloned. Note: CPQ does not invoke this method when you clone any proposal using the standard Salesforce Clone button. You must create a custom button or a formula field on the Proposal object to invoke this method after cloning a proposal. |
afterCreateAgreement() | void afterCreateAgreement(Apttus_Proposal__Proposal__c, Apttus__APTS_Agreement__c) | You can use this method to execute custom logic after the agreement is created from proposal. |
afterCreateFromAccount() | void afterCreateFromAccount(Apttus_Proposal__Proposal__c) | You can use this method to execute custom logic after the proposal is created from account. Note: CPQ only invokes this method when you execute the Apttus_Proposal.ProposalWebService.afterCreateFromAccount API. |
afterCreateFromOpportunity() | void afterCreateFromOpportunity(Apttus_Proposal__Proposal__c) | You can use this method to execute custom logic after the proposal is created from opportunity. Note: CPQ only invokes this method when you execute the Apttus_Proposal.ProposalWebService.afterCreateFromOpportunity API. |
afterComplete() | void afterComplete(Apttus_Proposal__Proposal__c, Apttus_Proposal.CustomClass.ActionType) | You can use this method to execute custom logic after proposal lifecycle is completed. |
afterComplete() | void afterComplete(Apttus__APTS_Agreement__c, Apttus_Proposal.CustomClass.ActionType) | You can use this method to execute custom logic after agreement lifecycle is completed. |
Example
You can use this callback to a scenario like:
- After you create a new proposal from Opportunity, values of Bill To Account and Ship To Account fields should be automatically set from the same fields that are present in the associated account.
- When you clone a proposal, you should have information about the proposal from which the new proposal was cloned from.