For a standard object, this API submits the generate document action using the given template from templateId and for a sObject from sObjectId and sObjectType. The output format of the generated document is of the type specified in the docFormat parameter.
 


API

Signature

submitGenerateCustomDoc

webService static Id submitGenerateCustomDoc(Id templateId, Id sObjectId, String sObjectType, String pLevel, String docFormat, Boolean isDraft, String sessionId, String serverUrl)


Request Parameters
NameTypeDescriptionRequired?
templateIdIDThe id of the template used to generate the word doc.Yes
sObjectIdIDThe sObject id which comprises the data for the merge fields.Yes
sObjectTypeStringThe type of the sObject.Yes
pLevelStringThe protection level to apply to the document. Valid values are:
  • Full access
  • Insert comments only
  • Insert comments and tracked changes only
  • Read only
  • Fill in form fields only
Yes
docFormatStringIndicates whether the document will be:
  • DOC
  • DOCX
  • PDF
  • RTF
Yes
isDraftBooleanIndicates whether a draft watermark should be added to the document.Yes
sessionIdStringThe Salesforce session id.Yes
serverUrlStringThe Salesforce server id.Yes



Response Parameter
NameTypeDescription
resultIDThe id of the generated document.


Code Sample

ID templateId = 'a036100000Fha5D'
ID sObjectId = '0016100000KvBHi';
String sObjectType = 'Account';
String pLevel = 'Full access';
String docFormat = 'DOC';
Boolean isDraft= false;
String sessionId = sessionId; //This is the session Id.
String serverUrl = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/14.0/' + UserInfo.getOrganizationId();

ID callId = Apttus.MergeWebService.submitGenerateCustomDoc(templateId,sObjectId,sObjectType,pLevel,docFormat,isDraft,sessionId,serverUrl);
CODE

Integration Details

Use the following information in your integrations with Apttus Contract Management Web Services API. For information on how to get started, refer to Integrating Apttus with External Systems.

API Prerequisites

None.

Request/Response XML

Example Request

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://soap.sforce.com/schemas/class/Apttus/MergeWebService">
   <soapenv:Header>
      <mer:SessionHeader>
         <mer:sessionId>00D020000008lUh!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId>
      </mer:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <mer:submitGenerateCustomDoc>
         <mer:templateId>a09R000000AjMCy</mer:templateId>
         <mer:sObjectId>0015500000YAdXR</mer:sObjectId>
         <mer:sObjectType>Account</mer:sObjectType>
         <mer:pLevel>Full Access</mer:pLevel>
         <mer:docFormat>PDF</mer:docFormat>
         <mer:isDraft>False</mer:isDraft>
         <mer:sessionId>00D020000008lUh!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId>
         <mer:serverUrl>https://testmanaged--5s20minor.my.salesforce.com/services/Soap/u/49.0/00D020000008lUh</mer:serverUrl>
      </mer:submitGenerateCustomDoc>
   </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus/MergeWebService">
   <soapenv:Body>
      <submitGenerateCustomDocResponse>
         <result>a0G020000009fMlEAI</result>
      </submitGenerateCustomDocResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML