• kartik_salesforce
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hi All

we have email template in -- Communication Templates-->Email Templates (HTML Type template having image in letterhead) and placeholdr field like {!Account.Name}  

Technically we need to download HTML Type templates from VF Page after button click on a word .doc

Contents of our generate document VF Page

<apex:page controller="PCDMassEmailMailMergeController_Total" cache="true" contentType="application/MSWord#MassMail_{!segDocName}_{!uniqueIDmassemail}.doc" >
<html xmlns:w="urn:schemas-microsoft-com:office:word">

<apex:outputText escape="false"/>
<body>

<pre><b><apex:outputtext value="{!chosenEmailTemplateVal.Name}" escape="false"/>_Subject:<apex:outputtext value="{!chosenEmailTemplateVal.Subject}" escape="false"/></b></pre>
<pre><apex:outputtext value="{!chosenEmailTemplateVal.Body}" escape="true"/></pre>
<!--<pre><apex:outputtext value="{!chosenEmailTemplateVal.HtmlValue}" escape="true"/></pre>--> (this option works well for SFDC Preview but not in generate doc)
<apex:outputtext value="{!mailHtmlBody}" escape="false"/>
<apex:outputtext value="{!blobType}" escape="false"/>
<apex:outputtext value="{!test}" escape="false"/>
</body>
</html>
</apex:page>

Regards
Kartik
In our Task in Salesforce we generate one CSV file and one doc file after one button click on salesforce screen. we need to download these two documents without the popup message "Do you want to Open or save this file"

can this be achieved using Apex Coding/Visualforce page .This happens on google chrome and we need that behaviour in IE  8,9 on Win XP and Win 7 .Kindly let me know

Thanks
Kartik
In our Task in Salesforce we generate one CSV file and one doc file after one button click on salesforce screen. we need to download these two documents without the popup message "Do you want to Open or save this file"

can this be achieved using Apex Coding/Visualforce page .This happens on google chrome and we need that behaviour in IE  8,9 on Win XP and Win 7 .Kindly let me know

Thanks
Kartik
In our Task in Salesforce we generate one CSV file and one doc file after one button click on salesforce screen. we need to download these two documents without the popup message "Do you want to Open or save this file"

can this be achieved using Apex Coding/Visualforce page .This happens on google chrome and we need that behaviour in IE  8,9 on Win XP and Win 7 .Kindly let me know

Thanks
Kartik
In our Task in Salesforce we generate one CSV file and one doc file after one button click on salesforce screen. we need to download these two documents without the popup message "Do you want to Open or save this file"

can this be achieved using Apex Coding/Visualforce page .This happens on google chrome and we need that behaviour in IE  8,9 on Win XP and Win 7 .Kindly let me know

Thanks
Kartik

Hi

 

I have a Custom Page which is based on Contact Object. Now I need to display Views which are on Standard Contact Pageon Custom VF Page . I should also be able to Edit and Create new Views just like in  Standard page Process. The problem is If I use Standard Controller= "Contact" and Extensions= "Custom_Pagination" I get an error on StandardsetController in apex code. Kindly help me in this plssss

 

VF Page:

<apex:page controller="Custom_Pagination">
<style type="text/css">
.loadingIcon {
background-image: url(/img/loading.gif);
width: 16px;
height: 16px;
}

</style>
<script type="text/javascript">
function checkClicked(){
var isChecked = false;
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++){
if(inputElem[i].checked){
isChecked = true;
}
}
if(isChecked){callMe();}
else{
alert('Please select at least one Contact');
return false;
}
}
function checkAll(cb,cbid)
{
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++)
{

if(inputElem[i].id.indexOf(cbid)!=-1){
inputElem[i].checked = cb.checked;
}
}
}
function highlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#8DEEEE"
// alert('1');
}
function dehighlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#FFFFFF"
// alert('1');
}
</script>
<apex:form id="form">
<br/>
<div style="align:right;">
<apex:repeat value="{!alphabet}" var="a">
<apex:commandLink id="sample" value="{!a}" action="{!refreshList2}" rerender="block,block2" onmouseout="dehighlight(this);" onmouseover="highlight(this);" style="text-decoration:none;" status="stat">
<apex:param name="alpha" value="{!a}"/>
</apex:commandLink>
<apex:outputLabel style="color : #CCC;">&nbsp;|&nbsp;</apex:outputLabel>
</apex:repeat>
</div>
<br/>
<apex:pageBlock id="block">
<apex:pageBlockButtons location="top" >
<apex:commandButton value="Generate Email" onclick="checkClicked();" reRender="msg"/>
<apex:actionFunction name="callMe" action="{!selectTemplate}"/>
<apex:commandButton rendered="{!standardsetcon.hasprevious}" value="Previous" action="{!standardsetcon.previous}" rerender="block,block2" status="stat"/>
<apex:commandButton rendered="{!standardsetcon.hasnext}" value="Next" action="{!standardsetcon.next}" rerender="block,block2" status="stat"/>

</apex:pageBlockButtons>
<apex:actionStatus id="stat">
<apex:facet name="start">
<apex:outputPanel layout="block" styleClass="message infoM4">
<apex:panelGrid columns="2" styleClass="messageTable" columnClasses="messageCell" style="padding:0px;margin:0px;">
<apex:panelGroup >
<img class="loadingIcon" src="/s.gif"/>
</apex:panelGroup>
<apex:panelGroup >
<div class="messageText">Please wait...</div>
</apex:panelGroup>
</apex:panelGrid>
</apex:outputPanel>
</apex:facet>
<apex:facet name="stop">
<apex:pageBlockTable value="{!CurrentList}" var="c" id="table">
<apex:column >
<apex:facet name="header"><apex:inputcheckbox onclick="checkAll(this,'check')" value="{!fals}" /></apex:facet>
<apex:inputcheckbox value="{!c.checked}" id="check"/>
</apex:column>
<apex:column value="{!c.ocontact.name}" headerValue="Name"/>
<apex:column value="{!c.ocontact.AccountId}" headerValue="Account"/>
<apex:column value="{!c.ocontact.phone}" headerValue="Phone"/>
<apex:column value="{!c.ocontact.Email}" headerValue="Email"/>
<apex:column value="{!c.ocontact.Email_1__c}" headerValue="Email one"/>
<apex:column value="{!c.ocontact.Status__c}" headerValue="Status"/>
</apex:pageBlockTable>
</apex:facet>
</apex:actionStatus>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

--------------

public with sharing class Custom_Pagination {

public String templates { get; set; }
public List<emailtemplate> searchedTemplate;
public List<emailtemplate> getSearchTemp(){return searchedTemplate; }
private static List<EmailTemplate> allEmailTemplates = new List<EmailTemplate>() ;
private static List<Folder> allEmailTemplateFolders = new List<Folder>() ;
public String selectedEmailTemplateFolder {public get; public set;}
public String selectedEmailTemplate {public get; public set;}
public EmailTemplate chosenEmailTemplate {public get; private set;}
public PageReference renderTemplate() {
searchedTemplate = [select id,name, subject, body from EmailTemplate where id=:templates];
return null;
}

public List<SelectOption> getemailTemplates(){
List<SelectOption> options = new List<SelectOption>();
List<EmailTemplate> et = [select id,name, subject, body from EmailTemplate];
for( EmailTemplate f : et)
{
options.add(new SelectOption(f.Id, f.Name));
}
return options;
}

public PageReference checkType() {
if(template=='Outlook'){
return new PageReference('/apex/generateCsv');
}
else if(template=='SFDC Template'){
return new PageReference('/apex/Select_Email_Template');
}
return null;
}
public PageReference B() {
/* your action here */
return new PageReference('/apex/generateCsv');
}
public PageReference A() {
/* your action here */
return new PageReference('/apex/Generate_Document');
}
public PageReference C() {
/* your action here */
return new PageReference('/apex/Mass_Mail_Contact');
}
public String template;

public String gettemplate(){
return template;
}

public void settemplate(String template){
this.template = template;
}

public PageReference selectTemplate() {
return new PageReference('/apex/Mass_Mail_Comm_Type');
}



private List<contactSet> contactSetList{get;set;}
private string contactListQuery;
private set<contact> selectedContact;

public List<string> alphabet{get;set;}
public boolean fals{get;set;}

public Custom_Pagination(){
fals=false;
alphabet=new string[]{'All','A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
contactSetList = new List<contactSet>();
selectedContact = new set<contact>();
contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact limit 1000';
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100];
//allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
}

Private void updateSelectedContact(){
for(contactSet cs:contactSetList ){
if(cs.checked)
selectedcontact.add(cs.ocontact);
else{
if(selectedcontact.contains(cs.ocontact))
selectedcontact.remove(cs.ocontact);
}
}
}

public ApexPages.StandardSetController standardSetCon {
get {
if(standardSetCon == null) {
standardSetCon = new ApexPages.StandardSetController(Database.getQueryLocator(contactListQuery));
// sets the number of records in each page set
standardSetCon .setPageSize(20);
}
return standardSetCon ;
}
set;
}

public List<contactSet> getCurrentList() {
updateSelectedContact();
contactSetList = new List<contactSet>();
for (contact category : (List<contact>)standardSetCon.getRecords()){
if(selectedContact.contains(category))
contactSetList.add(new contactSet(category,'true'));
else
contactSetList.add(new contactSet(category));
}
fals=false;
return contactSetList;
}

public PageReference refreshList2() {
standardSetCon = null;
string s;
if(apexpages.currentpage().getparameters().get('alpha') == 'All')
s='%';
else
s= apexpages.currentpage().getparameters().get('alpha')+'%';

contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact where name like' +'\''+s +'\''+ 'limit 5000';
return null;
}



public List<contact> getDisplaySelectedList(){
updateSelectedContact();
List<contact> displaycon = new list<contact>();
displaycon.addall(selectedcontact);
return displaycon;
}

public class contactSet {
public Boolean checked{ get; set; }
public contact ocontact { get; set;}

public contactSet(){
ocontact = new contact();
checked = false;
}
public contactSet(contact c){
ocontact = c;
checked = false;

}
public contactSet(contact c,string s){
ocontact = c;
checked = true;

}
}

//public Custom_Email_Folder() {
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100 ];
// allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email' ];
// }

public List<SelectOption> getEmailTemplateFolderOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
opts.add(new SelectOption('null', ' - Select - '));
for ( Folder f : allEmailTemplateFolders )
opts.add(new SelectOption(f.Id, f.Name));
// add an option for templates in the Unfiled Public folder
opts.add(new SelectOption(UserInfo.getOrganizationId(), 'Unified Public Email Templates'));
opts.add(new SelectOption(UserInfo.getUserId(), 'My Personal Email Templates'));
return opts;
}

public List<SelectOption> getEmailTemplateOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
if ( selectedEmailTemplateFolder != null ) {
opts.add(new SelectOption('null', ' - Select - '));
Id selectedId = (Id) selectedEmailTemplateFolder;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.FolderId == selectedId )
opts.add(new SelectOption(et.Id, et.Name));
}
}
return opts;
}

public PageReference refreshEmailTemplateSection() {
// this is a bit ugly, but a consequence of not being able to set a SelectOption's value to null
if ( selectedEmailTemplateFolder == null || selectedEmailTemplateFolder == 'null' ) {
selectedEmailTemplateFolder = null;
selectedEmailTemplate = null;
}
if ( selectedEmailTemplate == null || selectedEmailTemplate == 'null' ) {
selectedEmailTemplate = null;
chosenEmailTemplate = null;
} else {
Id selectedId = (Id) selectedEmailTemplate;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.Id == selectedId ) {
chosenEmailTemplate = et;
break;
}
}
}
return null;
}
public String getPrintView()
{
return
'<!--[if gte mso 9]>' +
'<xml>' +
'<w:WordDocument>' +
'<w:View>Print</w:View>' +
'<w:Zoom>100</w:Zoom>' +
'<w:DoNotOptimizeForBrowser/>' +
'</w:WordDocument>' +
'</xml>' +
'<![endif]>';
}

}

Hi

 

I have a Custom Page which is based on Contact Object. Now I need to display Views which are on Standard Contact Pageon Custom VF Page . I should also be able to Edit and Create new Views just like in  Standard page Process

 

VF Page:

<apex:page controller="Custom_Pagination">
<style type="text/css">
.loadingIcon {
background-image: url(/img/loading.gif);
width: 16px;
height: 16px;
}

</style>
<script type="text/javascript">
function checkClicked(){
var isChecked = false;
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++){
if(inputElem[i].checked){
isChecked = true;
}
}
if(isChecked){callMe();}
else{
alert('Please select at least one Contact');
return false;
}
}
function checkAll(cb,cbid)
{
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++)
{

if(inputElem[i].id.indexOf(cbid)!=-1){
inputElem[i].checked = cb.checked;
}
}
}
function highlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#8DEEEE"
// alert('1');
}
function dehighlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#FFFFFF"
// alert('1');
}
</script>
<apex:form id="form">
<br/>
<div style="align:right;">
<apex:repeat value="{!alphabet}" var="a">
<apex:commandLink id="sample" value="{!a}" action="{!refreshList2}" rerender="block,block2" onmouseout="dehighlight(this);" onmouseover="highlight(this);" style="text-decoration:none;" status="stat">
<apex:param name="alpha" value="{!a}"/>
</apex:commandLink>
<apex:outputLabel style="color : #CCC;">&nbsp;|&nbsp;</apex:outputLabel>
</apex:repeat>
</div>
<br/>
<apex:pageBlock id="block">
<apex:pageBlockButtons location="top" >
<apex:commandButton value="Generate Email" onclick="checkClicked();" reRender="msg"/>
<apex:actionFunction name="callMe" action="{!selectTemplate}"/>
<apex:commandButton rendered="{!standardsetcon.hasprevious}" value="Previous" action="{!standardsetcon.previous}" rerender="block,block2" status="stat"/>
<apex:commandButton rendered="{!standardsetcon.hasnext}" value="Next" action="{!standardsetcon.next}" rerender="block,block2" status="stat"/>

</apex:pageBlockButtons>
<apex:actionStatus id="stat">
<apex:facet name="start">
<apex:outputPanel layout="block" styleClass="message infoM4">
<apex:panelGrid columns="2" styleClass="messageTable" columnClasses="messageCell" style="padding:0px;margin:0px;">
<apex:panelGroup >
<img class="loadingIcon" src="/s.gif"/>
</apex:panelGroup>
<apex:panelGroup >
<div class="messageText">Please wait...</div>
</apex:panelGroup>
</apex:panelGrid>
</apex:outputPanel>
</apex:facet>
<apex:facet name="stop">
<apex:pageBlockTable value="{!CurrentList}" var="c" id="table">
<apex:column >
<apex:facet name="header"><apex:inputcheckbox onclick="checkAll(this,'check')" value="{!fals}" /></apex:facet>
<apex:inputcheckbox value="{!c.checked}" id="check"/>
</apex:column>
<apex:column value="{!c.ocontact.name}" headerValue="Name"/>
<apex:column value="{!c.ocontact.AccountId}" headerValue="Account"/>
<apex:column value="{!c.ocontact.phone}" headerValue="Phone"/>
<apex:column value="{!c.ocontact.Email}" headerValue="Email"/>
<apex:column value="{!c.ocontact.Email_1__c}" headerValue="Email one"/>
<apex:column value="{!c.ocontact.Status__c}" headerValue="Status"/>
</apex:pageBlockTable>
</apex:facet>
</apex:actionStatus>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

--------------

public with sharing class Custom_Pagination {

public String templates { get; set; }
public List<emailtemplate> searchedTemplate;
public List<emailtemplate> getSearchTemp(){return searchedTemplate; }
private static List<EmailTemplate> allEmailTemplates = new List<EmailTemplate>() ;
private static List<Folder> allEmailTemplateFolders = new List<Folder>() ;
public String selectedEmailTemplateFolder {public get; public set;}
public String selectedEmailTemplate {public get; public set;}
public EmailTemplate chosenEmailTemplate {public get; private set;}
public PageReference renderTemplate() {
searchedTemplate = [select id,name, subject, body from EmailTemplate where id=:templates];
return null;
}

public List<SelectOption> getemailTemplates(){
List<SelectOption> options = new List<SelectOption>();
List<EmailTemplate> et = [select id,name, subject, body from EmailTemplate];
for( EmailTemplate f : et)
{
options.add(new SelectOption(f.Id, f.Name));
}
return options;
}

public PageReference checkType() {
if(template=='Outlook'){
return new PageReference('/apex/generateCsv');
}
else if(template=='SFDC Template'){
return new PageReference('/apex/Select_Email_Template');
}
return null;
}
public PageReference B() {
/* your action here */
return new PageReference('/apex/generateCsv');
}
public PageReference A() {
/* your action here */
return new PageReference('/apex/Generate_Document');
}
public PageReference C() {
/* your action here */
return new PageReference('/apex/Mass_Mail_Contact');
}
public String template;

public String gettemplate(){
return template;
}

public void settemplate(String template){
this.template = template;
}

public PageReference selectTemplate() {
return new PageReference('/apex/Mass_Mail_Comm_Type');
}



private List<contactSet> contactSetList{get;set;}
private string contactListQuery;
private set<contact> selectedContact;

public List<string> alphabet{get;set;}
public boolean fals{get;set;}

public Custom_Pagination(){
fals=false;
alphabet=new string[]{'All','A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
contactSetList = new List<contactSet>();
selectedContact = new set<contact>();
contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact limit 1000';
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100];
//allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
}

Private void updateSelectedContact(){
for(contactSet cs:contactSetList ){
if(cs.checked)
selectedcontact.add(cs.ocontact);
else{
if(selectedcontact.contains(cs.ocontact))
selectedcontact.remove(cs.ocontact);
}
}
}

public ApexPages.StandardSetController standardSetCon {
get {
if(standardSetCon == null) {
standardSetCon = new ApexPages.StandardSetController(Database.getQueryLocator(contactListQuery));
// sets the number of records in each page set
standardSetCon .setPageSize(20);
}
return standardSetCon ;
}
set;
}

public List<contactSet> getCurrentList() {
updateSelectedContact();
contactSetList = new List<contactSet>();
for (contact category : (List<contact>)standardSetCon.getRecords()){
if(selectedContact.contains(category))
contactSetList.add(new contactSet(category,'true'));
else
contactSetList.add(new contactSet(category));
}
fals=false;
return contactSetList;
}

public PageReference refreshList2() {
standardSetCon = null;
string s;
if(apexpages.currentpage().getparameters().get('alpha') == 'All')
s='%';
else
s= apexpages.currentpage().getparameters().get('alpha')+'%';

contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact where name like' +'\''+s +'\''+ 'limit 5000';
return null;
}



public List<contact> getDisplaySelectedList(){
updateSelectedContact();
List<contact> displaycon = new list<contact>();
displaycon.addall(selectedcontact);
return displaycon;
}

public class contactSet {
public Boolean checked{ get; set; }
public contact ocontact { get; set;}

public contactSet(){
ocontact = new contact();
checked = false;
}
public contactSet(contact c){
ocontact = c;
checked = false;

}
public contactSet(contact c,string s){
ocontact = c;
checked = true;

}
}

//public Custom_Email_Folder() {
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100 ];
// allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email' ];
// }

public List<SelectOption> getEmailTemplateFolderOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
opts.add(new SelectOption('null', ' - Select - '));
for ( Folder f : allEmailTemplateFolders )
opts.add(new SelectOption(f.Id, f.Name));
// add an option for templates in the Unfiled Public folder
opts.add(new SelectOption(UserInfo.getOrganizationId(), 'Unified Public Email Templates'));
opts.add(new SelectOption(UserInfo.getUserId(), 'My Personal Email Templates'));
return opts;
}

public List<SelectOption> getEmailTemplateOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
if ( selectedEmailTemplateFolder != null ) {
opts.add(new SelectOption('null', ' - Select - '));
Id selectedId = (Id) selectedEmailTemplateFolder;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.FolderId == selectedId )
opts.add(new SelectOption(et.Id, et.Name));
}
}
return opts;
}

public PageReference refreshEmailTemplateSection() {
// this is a bit ugly, but a consequence of not being able to set a SelectOption's value to null
if ( selectedEmailTemplateFolder == null || selectedEmailTemplateFolder == 'null' ) {
selectedEmailTemplateFolder = null;
selectedEmailTemplate = null;
}
if ( selectedEmailTemplate == null || selectedEmailTemplate == 'null' ) {
selectedEmailTemplate = null;
chosenEmailTemplate = null;
} else {
Id selectedId = (Id) selectedEmailTemplate;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.Id == selectedId ) {
chosenEmailTemplate = et;
break;
}
}
}
return null;
}
public String getPrintView()
{
return
'<!--[if gte mso 9]>' +
'<xml>' +
'<w:WordDocument>' +
'<w:View>Print</w:View>' +
'<w:Zoom>100</w:Zoom>' +
'<w:DoNotOptimizeForBrowser/>' +
'</w:WordDocument>' +
'</xml>' +
'<![endif]>';
}

}

Hello sfdc experts and guru's

 

2 Questions from my end:--

 

1)  I looked at videos of informatica cloud and have seen that we can establish a connection(data sync) between  oracle server and salesforce .if i make a change in salesforce data  that change will be in sync with oracle server ( this is ok) .now if some other user of oracle server who hasnt installed informatica cloud makes change to the same oracle database table. will this change be reflected

 

2) I would love to get a step by step process on how to integrate salesforce with Informatica without using informatica cloud. Someone pls help regarding this.

 

Thanks

kartik

Hi All

we have email template in -- Communication Templates-->Email Templates (HTML Type template having image in letterhead) and placeholdr field like {!Account.Name}  

Technically we need to download HTML Type templates from VF Page after button click on a word .doc

Contents of our generate document VF Page

<apex:page controller="PCDMassEmailMailMergeController_Total" cache="true" contentType="application/MSWord#MassMail_{!segDocName}_{!uniqueIDmassemail}.doc" >
<html xmlns:w="urn:schemas-microsoft-com:office:word">

<apex:outputText escape="false"/>
<body>

<pre><b><apex:outputtext value="{!chosenEmailTemplateVal.Name}" escape="false"/>_Subject:<apex:outputtext value="{!chosenEmailTemplateVal.Subject}" escape="false"/></b></pre>
<pre><apex:outputtext value="{!chosenEmailTemplateVal.Body}" escape="true"/></pre>
<!--<pre><apex:outputtext value="{!chosenEmailTemplateVal.HtmlValue}" escape="true"/></pre>--> (this option works well for SFDC Preview but not in generate doc)
<apex:outputtext value="{!mailHtmlBody}" escape="false"/>
<apex:outputtext value="{!blobType}" escape="false"/>
<apex:outputtext value="{!test}" escape="false"/>
</body>
</html>
</apex:page>

Regards
Kartik
In our Task in Salesforce we generate one CSV file and one doc file after one button click on salesforce screen. we need to download these two documents without the popup message "Do you want to Open or save this file"

can this be achieved using Apex Coding/Visualforce page .This happens on google chrome and we need that behaviour in IE  8,9 on Win XP and Win 7 .Kindly let me know

Thanks
Kartik

Hi

 

I have a Custom Page which is based on Contact Object. Now I need to display Views which are on Standard Contact Pageon Custom VF Page . I should also be able to Edit and Create new Views just like in  Standard page Process

 

VF Page:

<apex:page controller="Custom_Pagination">
<style type="text/css">
.loadingIcon {
background-image: url(/img/loading.gif);
width: 16px;
height: 16px;
}

</style>
<script type="text/javascript">
function checkClicked(){
var isChecked = false;
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++){
if(inputElem[i].checked){
isChecked = true;
}
}
if(isChecked){callMe();}
else{
alert('Please select at least one Contact');
return false;
}
}
function checkAll(cb,cbid)
{
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++)
{

if(inputElem[i].id.indexOf(cbid)!=-1){
inputElem[i].checked = cb.checked;
}
}
}
function highlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#8DEEEE"
// alert('1');
}
function dehighlight (word) {
//alert('1');
document.getElementById (word.id).style.backgroundColor="#FFFFFF"
// alert('1');
}
</script>
<apex:form id="form">
<br/>
<div style="align:right;">
<apex:repeat value="{!alphabet}" var="a">
<apex:commandLink id="sample" value="{!a}" action="{!refreshList2}" rerender="block,block2" onmouseout="dehighlight(this);" onmouseover="highlight(this);" style="text-decoration:none;" status="stat">
<apex:param name="alpha" value="{!a}"/>
</apex:commandLink>
<apex:outputLabel style="color : #CCC;">&nbsp;|&nbsp;</apex:outputLabel>
</apex:repeat>
</div>
<br/>
<apex:pageBlock id="block">
<apex:pageBlockButtons location="top" >
<apex:commandButton value="Generate Email" onclick="checkClicked();" reRender="msg"/>
<apex:actionFunction name="callMe" action="{!selectTemplate}"/>
<apex:commandButton rendered="{!standardsetcon.hasprevious}" value="Previous" action="{!standardsetcon.previous}" rerender="block,block2" status="stat"/>
<apex:commandButton rendered="{!standardsetcon.hasnext}" value="Next" action="{!standardsetcon.next}" rerender="block,block2" status="stat"/>

</apex:pageBlockButtons>
<apex:actionStatus id="stat">
<apex:facet name="start">
<apex:outputPanel layout="block" styleClass="message infoM4">
<apex:panelGrid columns="2" styleClass="messageTable" columnClasses="messageCell" style="padding:0px;margin:0px;">
<apex:panelGroup >
<img class="loadingIcon" src="/s.gif"/>
</apex:panelGroup>
<apex:panelGroup >
<div class="messageText">Please wait...</div>
</apex:panelGroup>
</apex:panelGrid>
</apex:outputPanel>
</apex:facet>
<apex:facet name="stop">
<apex:pageBlockTable value="{!CurrentList}" var="c" id="table">
<apex:column >
<apex:facet name="header"><apex:inputcheckbox onclick="checkAll(this,'check')" value="{!fals}" /></apex:facet>
<apex:inputcheckbox value="{!c.checked}" id="check"/>
</apex:column>
<apex:column value="{!c.ocontact.name}" headerValue="Name"/>
<apex:column value="{!c.ocontact.AccountId}" headerValue="Account"/>
<apex:column value="{!c.ocontact.phone}" headerValue="Phone"/>
<apex:column value="{!c.ocontact.Email}" headerValue="Email"/>
<apex:column value="{!c.ocontact.Email_1__c}" headerValue="Email one"/>
<apex:column value="{!c.ocontact.Status__c}" headerValue="Status"/>
</apex:pageBlockTable>
</apex:facet>
</apex:actionStatus>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

--------------

public with sharing class Custom_Pagination {

public String templates { get; set; }
public List<emailtemplate> searchedTemplate;
public List<emailtemplate> getSearchTemp(){return searchedTemplate; }
private static List<EmailTemplate> allEmailTemplates = new List<EmailTemplate>() ;
private static List<Folder> allEmailTemplateFolders = new List<Folder>() ;
public String selectedEmailTemplateFolder {public get; public set;}
public String selectedEmailTemplate {public get; public set;}
public EmailTemplate chosenEmailTemplate {public get; private set;}
public PageReference renderTemplate() {
searchedTemplate = [select id,name, subject, body from EmailTemplate where id=:templates];
return null;
}

public List<SelectOption> getemailTemplates(){
List<SelectOption> options = new List<SelectOption>();
List<EmailTemplate> et = [select id,name, subject, body from EmailTemplate];
for( EmailTemplate f : et)
{
options.add(new SelectOption(f.Id, f.Name));
}
return options;
}

public PageReference checkType() {
if(template=='Outlook'){
return new PageReference('/apex/generateCsv');
}
else if(template=='SFDC Template'){
return new PageReference('/apex/Select_Email_Template');
}
return null;
}
public PageReference B() {
/* your action here */
return new PageReference('/apex/generateCsv');
}
public PageReference A() {
/* your action here */
return new PageReference('/apex/Generate_Document');
}
public PageReference C() {
/* your action here */
return new PageReference('/apex/Mass_Mail_Contact');
}
public String template;

public String gettemplate(){
return template;
}

public void settemplate(String template){
this.template = template;
}

public PageReference selectTemplate() {
return new PageReference('/apex/Mass_Mail_Comm_Type');
}



private List<contactSet> contactSetList{get;set;}
private string contactListQuery;
private set<contact> selectedContact;

public List<string> alphabet{get;set;}
public boolean fals{get;set;}

public Custom_Pagination(){
fals=false;
alphabet=new string[]{'All','A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
contactSetList = new List<contactSet>();
selectedContact = new set<contact>();
contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact limit 1000';
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100];
//allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
}

Private void updateSelectedContact(){
for(contactSet cs:contactSetList ){
if(cs.checked)
selectedcontact.add(cs.ocontact);
else{
if(selectedcontact.contains(cs.ocontact))
selectedcontact.remove(cs.ocontact);
}
}
}

public ApexPages.StandardSetController standardSetCon {
get {
if(standardSetCon == null) {
standardSetCon = new ApexPages.StandardSetController(Database.getQueryLocator(contactListQuery));
// sets the number of records in each page set
standardSetCon .setPageSize(20);
}
return standardSetCon ;
}
set;
}

public List<contactSet> getCurrentList() {
updateSelectedContact();
contactSetList = new List<contactSet>();
for (contact category : (List<contact>)standardSetCon.getRecords()){
if(selectedContact.contains(category))
contactSetList.add(new contactSet(category,'true'));
else
contactSetList.add(new contactSet(category));
}
fals=false;
return contactSetList;
}

public PageReference refreshList2() {
standardSetCon = null;
string s;
if(apexpages.currentpage().getparameters().get('alpha') == 'All')
s='%';
else
s= apexpages.currentpage().getparameters().get('alpha')+'%';

contactListQuery= 'select id,name,phone,Email,Email_1__c,AccountId,Status__c from contact where name like' +'\''+s +'\''+ 'limit 5000';
return null;
}



public List<contact> getDisplaySelectedList(){
updateSelectedContact();
List<contact> displaycon = new list<contact>();
displaycon.addall(selectedcontact);
return displaycon;
}

public class contactSet {
public Boolean checked{ get; set; }
public contact ocontact { get; set;}

public contactSet(){
ocontact = new contact();
checked = false;
}
public contactSet(contact c){
ocontact = c;
checked = false;

}
public contactSet(contact c,string s){
ocontact = c;
checked = true;

}
}

//public Custom_Email_Folder() {
//allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate limit 100 ];
// allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email' ];
// }

public List<SelectOption> getEmailTemplateFolderOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
opts.add(new SelectOption('null', ' - Select - '));
for ( Folder f : allEmailTemplateFolders )
opts.add(new SelectOption(f.Id, f.Name));
// add an option for templates in the Unfiled Public folder
opts.add(new SelectOption(UserInfo.getOrganizationId(), 'Unified Public Email Templates'));
opts.add(new SelectOption(UserInfo.getUserId(), 'My Personal Email Templates'));
return opts;
}

public List<SelectOption> getEmailTemplateOpts() {
allEmailTemplates = [select Id, Name, Subject, Body, FolderId from EmailTemplate ];
allEmailTemplateFolders = [select Id, Name from Folder where Type = 'Email'];
List<SelectOption> opts = new List<SelectOption>();
if ( selectedEmailTemplateFolder != null ) {
opts.add(new SelectOption('null', ' - Select - '));
Id selectedId = (Id) selectedEmailTemplateFolder;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.FolderId == selectedId )
opts.add(new SelectOption(et.Id, et.Name));
}
}
return opts;
}

public PageReference refreshEmailTemplateSection() {
// this is a bit ugly, but a consequence of not being able to set a SelectOption's value to null
if ( selectedEmailTemplateFolder == null || selectedEmailTemplateFolder == 'null' ) {
selectedEmailTemplateFolder = null;
selectedEmailTemplate = null;
}
if ( selectedEmailTemplate == null || selectedEmailTemplate == 'null' ) {
selectedEmailTemplate = null;
chosenEmailTemplate = null;
} else {
Id selectedId = (Id) selectedEmailTemplate;
for ( EmailTemplate et : allEmailTemplates ) {
if ( et.Id == selectedId ) {
chosenEmailTemplate = et;
break;
}
}
}
return null;
}
public String getPrintView()
{
return
'<!--[if gte mso 9]>' +
'<xml>' +
'<w:WordDocument>' +
'<w:View>Print</w:View>' +
'<w:Zoom>100</w:Zoom>' +
'<w:DoNotOptimizeForBrowser/>' +
'</w:WordDocument>' +
'</xml>' +
'<![endif]>';
}

}