Retrieving Templates in a Proposal
The API retrieves the templates associated with the given proposal.
API |
Signature |
---|---|
getTemplatesForProposal |
webService static List getTemplatesForProposal(Id proposalId, String proposalType) |
Request Parameter |
||
---|---|---|
Name |
Type |
Description |
proposalId | ID |
The ID of the proposal. |
proposalType | String |
The type of template to query |
Response Parameter |
||
---|---|---|
Field |
Type |
Description |
templateSOs | List<Apttus__APTS_Template__c> |
The list of templates matching the configured query criteria. |
Code Sample
The sample code below enables you to retrieve the list of templates for the given proposal.
/**
* The below code demonstrates how to get list of template records for the given proposal
*/
public List<Apttus__APTS_Template__c> getTemplatesForProposal(String proposalName)
{
Id proposalSOID = [SELECT Id FROM Apttus_Proposal__Proposal__c WHERE Name =: proposalName LIMIT 1].Id;
List<Apttus__APTS_Template__c> templateSOs = new List<Apttus__APTS_Template__c>();
templateSOs = Apttus_Proposal.ProposalWebService.getTemplatesForProposal(proposalSOID,'Proposal');
return templateSOs;
}