Download PDF
Download page Retrieving Proposal Field Values from Opportunity.
Retrieving Proposal Field Values from Opportunity
This API fetches the field values of the proposal object that are required to create a proposal from an opportunity. You can use the fetched values to create a new proposal.
API | Signature |
---|---|
createProposalFromOpportunity | webService static Apttus_Proposal__Proposal__c createProposalFromOpportunity(Id opptyId, Id recordTypeId) |
Request Parameter | ||
---|---|---|
Name | Type | Description |
opptyID | ID | The ID of the opportunity you need to retrieve values from. |
recordTypeId | ID | Record Type of the proposal object |
Response - Apttus_Proposal__Proposal__c | ||
---|---|---|
Field | Type | Description |
RecordTypeId | ID | Record Type of the proposal object |
Apttus_Proposal__Proposal_Name__c | String | The name of the proposal. |
Apttus_Proposal__Account__c | ID | The Id of the account associated with the proposal. |
Apttus_Proposal__Opportunity__c | ID | The Id of the opportunity associated with the proposal. |
Apttus_Proposal__Primary_Contact__c | ID | The primary contact associated with the proposal. |
Apttus_Proposal__Description__c | String | The description of the proposal. |
Apttus_Proposal__Primary__c | Boolean | Indicates whether the proposal is the primary quote to update the related opportunity. |
Apttus_Proposal__ReadyToGenerate__c | Boolean | Indicates whether the proposal is ready for generation. |
Apttus_Proposal__ReadyToPresent__c | Boolean | Indicates whether the proposal is ready for presentation. |
OwnerId | ID | The ID of the proposal object. |
CurrencyIsoCode | String | The currency defined for the proposal. |
Code Sample
The sample code below enables you to retrieve the proposal field values of the opportunity associated with the ID that you provide. You can use the standard createRecord API to create the proposal.
/**
* The below method demonstrates how to fetch the values proposal field values from an existing opporutnity
*/
public static Apttus_Proposal__Proposal__c createProposal(Id opportunityID) {
Apttus_Proposal__Proposal__c newProposalSO = new Apttus_Proposal__Proposal__c();
ID proposalRecordTypeID = [select ID FROM recordType where sObjectType='Apttus_Proposal__Proposal__c' AND Name = ‘Proposal’ LIMIT 1].Id;
newProposalSO = Apttus_Proposal.ProposalWebService.createProposalFromOpportunity(opportunityID, proposalRecordTypeID);
return newProposalSO;
}
Integration Details
Use the following information in your integrations with CPQ Web Services API. Refer to Integrating Conga with External Systems for information on how to get started.
API Prerequisites
None.
Response/Request XML
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prop="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService">
<soapenv:Header>
<prop:SessionHeader>
<prop:sessionId>00DZ000000NAEIA!ASAAQKosATSpsGeD7FUh4RDI18xnzIFPe80Mk89ejrAmDrCBY2lmyJKQjKvuwj3TvT71r6g_epvbo6FeqKUPfmSookHTttOu</prop:sessionId>
</prop:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<prop:createProposalFromOpportunity>
<prop:opptyId>006Z000000Gr9OD</prop:opptyId>
<prop:recordTypeId>012i00000001ECb</prop:recordTypeId>
</prop:createProposalFromOpportunity>
</soapenv:Body>
</soapenv:Envelope>
Example Response
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<createProposalFromOpportunityResponse>
<result xsi:type="Apttus_Proposal__Proposal__c">
<Id xsi:nil="true"/>
<Apttus_Proposal__Account__c>001Z000001V13ovIAB</Apttus_Proposal__Account__c>
<Apttus_Proposal__Opportunity__c>006Z000000Gr9ODIAZ</Apttus_Proposal__Opportunity__c>
<Apttus_Proposal__Primary__c>false</Apttus_Proposal__Primary__c>
<Apttus_Proposal__Proposal_Name__c>Auto_API_Opportunity</Apttus_Proposal__Proposal_Name__c>
<Apttus_Proposal__ReadyToGenerate__c>true</Apttus_Proposal__ReadyToGenerate__c>
<Apttus_Proposal__ReadyToPresent__c>true</Apttus_Proposal__ReadyToPresent__c>
<CurrencyIsoCode>USD</CurrencyIsoCode>
<OwnerId>0050U000000r444QAA</OwnerId>
<RecordTypeId>012i00000001ECbAAM</RecordTypeId>
</result>
</createProposalFromOpportunityResponse>
</soapenv:Body>
</soapenv:Envelope>
Create Proposal
Use data from the Response to create the proposal. The following example uses the createRecord() method to create the Proposal object.
Example Request
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:enterprise.soap.sforce.com"
xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>00DZ000000NAEIA!ASAAQKosATSpsGeD7FUh4RDI18xnzIFPe80Mk89ejrAmDrCBY2lmyJKQjKvuwj3TvT71r6g_epvbo6FeqKUPfmSookHTttOu</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:create>
<urn:sObjects xsi:type="urn1:Apttus_Proposal__Proposal__c">
<urn1:Apttus_Proposal__Proposal_Name__c>Auto_API_Opportunity</urn1:Apttus_Proposal__Proposal_Name__c>
<urn1:Apttus_Proposal__Account__c>001Z000001V13ovIAB</urn1:Apttus_Proposal__Account__c>
<urn1:Apttus_Proposal__Primary__c>false</urn1:Apttus_Proposal__Primary__c>
<urn1:Apttus_Proposal__ReadyToGenerate__c>true</urn1:Apttus_Proposal__ReadyToGenerate__c>
<urn1:Apttus_Proposal__ReadyToPresent__c>true</urn1:Apttus_Proposal__ReadyToPresent__c>
<urn1:CurrencyIsoCode>USD</urn1:CurrencyIsoCode>
<urn1:Apttus_Proposal__Opportunity__c>006Z000000Gr9OD</urn1:Apttus_Proposal__Opportunity__c>
<urn1:Apttus_QPConfig__PriceListId__c>a1De0000001yPXQ</urn1:Apttus_QPConfig__PriceListId__c>
</urn:sObjects>
</urn:create>
</soapenv:Body>
</soapenv:Envelope>
Example Response
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="http://soap.sforce.com/schemas/class/Apttus_Proposal/ProposalWebService"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<createProposalFromOpportunityResponse>
<result xsi:type="Apttus_Proposal__Proposal__c">
<Id xsi:nil="true"/>
<Apttus_Proposal__Account__c>001Z000001V13ovIAB</Apttus_Proposal__Account__c>
<Apttus_Proposal__Primary__c>false</Apttus_Proposal__Primary__c>
<Apttus_Proposal__Proposal_Name__c>Auto_API_Account</Apttus_Proposal__Proposal_Name__c>
<Apttus_Proposal__ReadyToGenerate__c>true</Apttus_Proposal__ReadyToGenerate__c>
<Apttus_Proposal__ReadyToPresent__c>true</Apttus_Proposal__ReadyToPresent__c>
<CurrencyIsoCode>USD</CurrencyIsoCode>
<OwnerId>0050U000000r444QAA</OwnerId>
</result>
</createProposalFromOpportunityResponse>
</soapenv:Body>
</soapenv:Envelope>