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

webService static Id convertWordDoc(Id docId, String docFileName, String docFormat, Id sObjectId, String pLevel, Boolean addWatermark, Boolean removeWatermark, String headerText, String footerText, String sessionId, String serverUrl)


Request Parameters
NameTypeDescriptionRequired?
docIdIDThe id of the agreement document to be converted in a different output format.Yes
docFileNameStringThe file name for the Word document.Yes
docFormatStringIndicates whether the document will be:
  • DOC
  • DOCX
  • RTF
Yes
sObjectIdIDThe sObject id for which you want to update the document.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
addWatermarkBooleanIndicates whether a draft watermark should be added to the output document.Yes
removeWatermarkBooleanIndicates whether a draft watermark on the source word document should be removed from the resulting document.Yes
headerTextStringThe header text to be appended to the document.Yes
footerTextStringThe footer text to be appended to the document.Yes
sessionIdStringThe Salesforce session id.Yes
serverUrlStringThe Salesforce server URL.Yes



Response Parameter
NameTypeDescription
resultIDThe 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) ; 
CODE