function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepakn12Deepakn12 

Invoke mail merge action from scontrol.

Hi All,
I have a record and I want to generate a document based on that record using mail merge. I have uploaded a word template in sfdc.
Now what i want, when user clicks on a particular button provided in my scontrol it needs to generate a document based on the template uplaoded in sfdc. In short i want to do the same action what sfdc is doing when some one clicks on mail merge button provided in record detail page.
Is it possible?
thx in advance.
Deepak.
London BenLondon Ben
For sure - If you have a lot of time on your hands you can develop something to do this....
 
...BUT I would take a look at Conga on appexchange
 
I bet it will make it easy to achieve your goal - and leave you with some spare time to do more fun things...
SunilSunil

Hi,


I have written few lines code in sControl for Mail merge and it is working fine: -


 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/9.0/connection.js"></script>
<script language="javascript">

function pageInit()
{
sforce.connection.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}");

document.location.href="https://na1.salesforce.com/mail/mmgen.jsp—retURL=%2F{!XYZ__c.Id}&dataURL=%2Fservlet%2Fservlet.SForceCommander%3Fp_type%3Dmailmerge%26id%3D{!XYZ__c.Id}%26did%3D01H600000005sJi%26cid%3D00000000000000"
}
</script>
</head>

<body onload="pageInit()">

</body>
</html>


 
First I did mail merge manually and when it generates mail merge file, I copied url from address bar of the explorer and updated mail merge templated id 01H600000005sJi with the related documents to generate.

Please let me know if you have any questions.

Thanks

Sunil


Message Edited by Sunil on 03-20-2008 02:52 AM

Message Edited by Sunil on 03-20-2008 02:56 AM

Message Edited by Sunil on 03-20-2008 03:17 AM