Converting a Word Document into a given output format for Standard Object (Deprecated)
For any standard object, this API converts a generated Word document into a specific output format, specified in docFormat using the parameters, such as, docId, docFileName. This API is deprecated.
API |
Signature |
---|---|
convertWordDoc |
|
Request Parameters |
|||
---|---|---|---|
Name |
Type |
Description |
Required? |
docId |
|
The id of the agreement document to be converted in a different output format. |
Yes |
docFileName |
|
The file name for the Word document. |
Yes |
docFormat |
|
Indicates whether the document will be:
|
Yes |
sObjectId |
|
The sObject id for which you want to update the document. |
Yes |
pLevel |
|
The protection level to apply to the document. Valid values are:
|
Yes |
addWatermark |
|
Indicates whether a draft watermark should be added to the output document. |
Yes |
removeWatermark |
|
Indicates whether a draft watermark on the source word document should be removed from the resulting document. |
Yes |
headerText |
|
The header text to be appended to the document. |
Yes |
footerText |
|
The footer text to be appended to the document. |
Yes |
sessionId |
|
The Salesforce session id. |
Yes |
serverUrl |
|
The Salesforce server URL. |
Yes |
Response Parameter |
||
---|---|---|
Name |
Type |
Description |
result |
|
The id of the converted document. |
Code Sample
ID docId = 'a0Y61000002K6IR';
String docFileName = 'Agreement';
String docFormat = 'PDF';
ID sObjectId = '0016100000KvBHi';
String pLevel = 'Full access';
Boolean addWatermark = true;
Boolean removeWatermark = false;
String headerText = 'Agreement Id: 0123456789';
String footerText = 'Date Created: 11/27/2018 7:23:15 PM';
String sessionId = sessionId; //This is the session Id.
String serverUrl = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId();
ID ConvertedDocId= Apttus.MergeSupport.convertWordDoc(docId,docFileName,docFormat,sObjectId,pLevel,addWatermark,removeWatermark,headerText,footerText,sessionId,serverUrl) ;