• NewIntern
  • NEWBIE
  • 54 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 23
    Replies

Question on email

Is there a way to prepopulate following on email when send email button is clicked (on emails related list) from Case screen.

 

1) Input Ref ID
2) Copy Case Team

 

Thanks

Usual page and custom controller stuff. 

 

There is this custom VF page that simulates the standard Send an Email page. I have all the required attachments stored in a local <list>attachment variable called attach_criteria. How do I make a transfer from this attach_criteria to fileAttachments so that I can set up the email attachments to be sent? I tried using the following for-loop:

 

 for(i=0; i < attach_criteria.size(); i++){
            messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
            efa.setFileName(attach_criteria[i].Name);
            efa.setBody(attach_criteria[i].Body);
            }
            message.setFileAttachments(fileAttachments);

but I get the error:

 

SObject row was retrieved via SOQL without querying the requested field: Attachment.Body

 

Please show me with code how I can pass values from attach_criteria to fileAttachments. Thanks for your time.

 

 

 

The field Subject of Task should define what value is fed into the Opportunity field Stage. When the subject field value changes to "Sub1" (example), I need the field Stage of Opportunity for Account_ABC to change to "Stage1" automatically.

 

How can I achieve this - a brief step by step on how to go about would be great. 

The following issue is on the Pro Edition and does not happen on Enterprise. I have this custom grid with several checkboxes in it. This grid is rendered through an inline VF component/section on the Accounts page layout.

 

Now, I can't get to display the checkbox inline unless the same checkbox is displayed in the detail section. Whatever checkboxes I have left out from detail, is not displayed inline. Here is a snapshot of my Account page, which shows the same 3 details checkboxes (at the top) displayed inline in the single-row grid...nothing more, nothing less:

 

http://i.stack.imgur.com/RuXp0.png

 

How can I get to display inline without displaying the same field in detail? Right now, it pretty much defeats the very purpose of having the VF section.

 

Appreciate your help; here is the VF page code:

 

<apex:page standardController="Account">
 <apex:form>
  <apex:pageBlock id="theBlock" mode="inlineEdit">
   <apex:pageBlockButtons >
    <apex:commandButton action="{!quickSave}" id="saveButton" value="Save"/>
   </apex:pageBlockButtons>

<!-- first row -->
    <apex:pageBlockTable value="{!Account}" var="c"> 

        <apex:column headerValue="Fund/Status" width="111">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>


        </apex:column>
          <apex:column headerValue="On Approved List" width="111">
            <apex:outputField value="{!c.EJF_Approved__c}">
               <apex:inlineEditSupport event="ondblclick"
                                       showOnEdit="saveButton"
                                       changedStyleClass="myBoldClass" 
                                       resetFunction="resetInlineEdit"/>
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Pending Approval" width="111">
            <apex:outputField value="{!c.EJF_Pending__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Denied Approval" width="111">
           <apex:outputField value="{!c.EJF_Denied__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Removed From Approved" width="127">
            <apex:outputField value="{!c.EJF_Removed__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="ADV Part II Sent" width="123">
            <apex:outputField value="{!c.EJF_ADV__c}"> 
                <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Fee Disclosure Signed" width="111">
           <apex:outputField value="{!c.EJF_FeeDisc__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
           </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Invested" width="101">
            <apex:outputField value="{!c.EJF_Invested__c}"> 
                 <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>


        </apex:column>
        <apex:column headerValue="Redeemed" width="101">
            <apex:outputField value="{!c.EJF_Redeemed__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
      </apex:pageBlockTable>
<!-- end of first row -->
    </apex:pageBlock>
  </apex:form>    
</apex:page>

 

I am confounded by this issue. I am able to display a custom SObject checkbox in an inline VF component on the Contact page layout. However, with the same code (this time std controller = Account), I am unable to display the checkbox on the Account page layout even though I can drag and drop the inline VF component onto the Account page.

 

Here is my VF page code:

<apex:page standardController="Account">
 <apex:form >
  <apex:pageBlock id="theBlock">
<!-- first row -->
    <apex:pageBlockTable value="{!Account}" var="a"> 

        <apex:column headerValue="Fund/Status">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>

        </apex:column>
          <apex:column headerValue="On Approved List">
              <apex:inputField value="{!a.EJF_Approved__c}"/> 
          </apex:column>

    </apex:pageBlockTable>
<!-- end of first row -->
  </apex:pageBlock>
 </apex:form>    
</apex:page>

 EJF_Approved is the name of the custom checkbox and is in the list of custom fields under Account fields:

 

http://i.stack.imgur.com/GPpP5.png  [SF page screenshot - "Account Custom Fields and Relationships"]

http://i.stack.imgur.com/0ocqU.png   [SF page screenshot - definition of custom checkbox in question]

 

On the accounts page, this is what I see - no checkbox:

http://i.stack.imgur.com/cvjXH.png

 

There are no errors. Finally, the Account tab is renamed to Investor. I don't think that's the spoiler but just to round up all possibly pertinent information.

 

It seems like I'm getting something fundamentally wrong here but don't quite see it. Please help.

 

I have an inline VF component grid on the Contacts page layout that I implemented using VF page and custom Apex class. The grid works absolutely fine in the Enterprise Edition; the main code for the VF page is:

 

<apex:page standardController="Contact" extensions="VFforEmailTemplateController">
<apex:form >
 <apex:pageBlock id="theBlock" mode="inlineEdit">
  <apex:pageBlockButtons >
    <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>
  </apex:pageBlockButtons>

<!-- first row -->
    <apex:pageBlockTable value="{!contact}" var="c"> 

                <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>

        <apex:column headerValue="Fund/Status" width="111">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>
        </apex:column>
          <apex:column headerValue="On Approved List" width="111">
            <apex:outputField value="{!c.EJF_On_Approved__c}">
               <apex:inlineEditSupport event="ondblclick"
                                       showOnEdit="saveButton"
                                       changedStyleClass="myBoldClass" 
                                       resetFunction="resetInlineEdit"/>
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Pending Approval" width="111">
            <apex:outputField value="{!c.EJF_Pend_App__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Denied Approval" width="111">
           <apex:outputField value="{!c.EJF_Denied__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Removed From Approved" width="127">
            <apex:outputField value="{!c.EJF_Removed__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="ADV Part II Sent" width="123">
            <apex:outputField value="{!c.EJF_ADV__c}"> 
                <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield> 
This code repeats for additional rows and columns.

 Now the Apex class saves the users' checkbox selection; the code:

 

public class VFforEmailTemplateController

{
    public Contact cont { get; set; }
    public ApexPages.StandardController c;

    public VFforEmailTemplateController(ApexPages.StandardController controller)
    {
    this.cont = (Contact)controller.getRecord();
        c = controller;

    }
    public PageReference saveRecord(){
        try{
            c.save();
        }
        catch(Exception e){
        }
        return null;
    }

}

Now, I need your help to determine if the same thing can be implemented in the Pro Edition. After checking it out, my initial thoughts are it may not be possible because you can't create an Apex class.

 

But is there a workaround as far as doing this in Pro? How would you implement the same grid if you only had Pro to work with? Thanks.

 

I have a custom link to pull in an email template of Template Type 'custom' and prepopulate certain fields. The URL content source for this link is:

 

/_ui/core/email/author/EmailAuthor?email_type=custom&template_id=00Xi0000000vRuv&id=00Yi0000000lGuY&p2_lkid={!Contact.Id}&rtype=003&retURL=%2F{!Contact.Id}

 

The problem is I am unable to do a quick editing of the prepopulated email body (not talking about editing the email template in setup) when the template is loaded before sending out the email. I know this is not possible using the standard Send An Email button too but what would be a neat workaround for this using my own link/button to send emails?

I realize fetching an email Template Type 'HTML' allows you to edit the email body but the HTML email has borders or blank columns on either side of the body as seen by the email recipient, making it look like a mass email, which I dislike.

Appreciate any tips/hacks to enable editing.

I have the following Visualforce page in the Contacts page layout:

 

http://i.stack.imgur.com/QfpZV.png

 

 

A single click will toggle the checkbox selection ( as expected) and update the SObject field value. This is all good. However, I want to be able to change the checkbox value on a double-click, not on a single click. Something like how the same custom SObject checkbox behaves when otherwise used directly on the SF page layout (versus on a VF page) would also be nice:

  

http://i.stack.imgur.com/QW29E.png

 

Here is my VF page code for the SObject checkbox:

 

<apex:pageBlock id="theBlock">
<!-- first row -->
    <apex:pageBlockTable value="{!contact}" var="c"> 
         <apex:column headerValue="On Approved List" width="111">
            <apex:inputField value="{!c.EJF_On_Approved__c}"> 
                <apex:actionSupport event="onclick" reRender="theBlock" action="{!saveRecord}"/> 
            </apex:inputfield>
        </apex:column>

 

Suggested changes to the code if provided as complete code would be highly appreciated. Thanks!

Hi,

 

I have a custom link titled Download on my Contacts page layout. Clicking this link directly downloads a custom report. I used URL content source to achieve this.

 

The download/export function works fine; however, on clicking download, I auto navigate to a blank page having the following URL in the browser URL bar: ...force.com/servlet/servlet.Integration?lid=00bi00000016M8D&eid=003i000000Bswj8&ic=1

 

I used the following URL in the content source for the Download link and the return functionality doesn't work: /00Oi0000002vZ5W?export=1&enc=ISO-8859-1&xf=xls&retURL=%2F003i000000Bswj8

 

where 003i000000Bswj8 is the Contact record ID that has the custom Download link and is the page to which I would like to redirect (or remain on) after the Download link is clicked. With how the URL works currently, the user has to manually click back on the browser to return to the Contact record.

 

How can I modify the URL so that I remain on the same Contact record instead of staring at the ensuing blank page? If JavaScript is the only solution, I would really appreciate the code pasted here.

 

Hi,

 

Can someone tell me why I do not see "Visualforce Pages" in the edit layout view of Accounts while I can see Visualforce Pages in the same view for Contacts? I can see Fields, Buttons, Custom Links, Related Lists, and Actions but no Visualforce Pages. How can I add a VF page on an Accounts record - I was neatly able to do so on Contacts but not on Accounts cause the option doesn't exist.

 

Thanks.

 

 

I have a visualforce page with standard controller 'contact' and an extension class. This visualforce page appears in a section on each Contacts record page. The page renders several SObject checkboxes. 

 

The issue is when a user clicks the checkbox, the selection is not remembered when the Contacts record page and therefore the VF page section are reloaded. How do I code the VF page so that when the Contact record is opened again, the checkboxes that were checked remain checked?

 

Please help.

The field Subject of Task should define what value is fed into the Opportunity field Stage. When the subject field value changes to "Sub1" (example), I need the field Stage of Opportunity for Account_ABC to change to "Stage1" automatically.

 

How can I achieve this - a brief step by step on how to go about would be great. 

I am confounded by this issue. I am able to display a custom SObject checkbox in an inline VF component on the Contact page layout. However, with the same code (this time std controller = Account), I am unable to display the checkbox on the Account page layout even though I can drag and drop the inline VF component onto the Account page.

 

Here is my VF page code:

<apex:page standardController="Account">
 <apex:form >
  <apex:pageBlock id="theBlock">
<!-- first row -->
    <apex:pageBlockTable value="{!Account}" var="a"> 

        <apex:column headerValue="Fund/Status">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>

        </apex:column>
          <apex:column headerValue="On Approved List">
              <apex:inputField value="{!a.EJF_Approved__c}"/> 
          </apex:column>

    </apex:pageBlockTable>
<!-- end of first row -->
  </apex:pageBlock>
 </apex:form>    
</apex:page>

 EJF_Approved is the name of the custom checkbox and is in the list of custom fields under Account fields:

 

http://i.stack.imgur.com/GPpP5.png  [SF page screenshot - "Account Custom Fields and Relationships"]

http://i.stack.imgur.com/0ocqU.png   [SF page screenshot - definition of custom checkbox in question]

 

On the accounts page, this is what I see - no checkbox:

http://i.stack.imgur.com/cvjXH.png

 

There are no errors. Finally, the Account tab is renamed to Investor. I don't think that's the spoiler but just to round up all possibly pertinent information.

 

It seems like I'm getting something fundamentally wrong here but don't quite see it. Please help.

 

I have an inline VF component grid on the Contacts page layout that I implemented using VF page and custom Apex class. The grid works absolutely fine in the Enterprise Edition; the main code for the VF page is:

 

<apex:page standardController="Contact" extensions="VFforEmailTemplateController">
<apex:form >
 <apex:pageBlock id="theBlock" mode="inlineEdit">
  <apex:pageBlockButtons >
    <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>
  </apex:pageBlockButtons>

<!-- first row -->
    <apex:pageBlockTable value="{!contact}" var="c"> 

                <apex:commandButton action="{!saveRecord}" id="saveButton" value="Save"/>

        <apex:column headerValue="Fund/Status" width="111">
            <apex:outputText >
                <b>EJF</b>
            </apex:outputText>
        </apex:column>
          <apex:column headerValue="On Approved List" width="111">
            <apex:outputField value="{!c.EJF_On_Approved__c}">
               <apex:inlineEditSupport event="ondblclick"
                                       showOnEdit="saveButton"
                                       changedStyleClass="myBoldClass" 
                                       resetFunction="resetInlineEdit"/>
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Pending Approval" width="111">
            <apex:outputField value="{!c.EJF_Pend_App__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Denied Approval" width="111">
           <apex:outputField value="{!c.EJF_Denied__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="Removed From Approved" width="127">
            <apex:outputField value="{!c.EJF_Removed__c}"> 
              <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield>
        </apex:column>
        <apex:column headerValue="ADV Part II Sent" width="123">
            <apex:outputField value="{!c.EJF_ADV__c}"> 
                <apex:inlineEditSupport event="ondblclick"
                                      showOnEdit="saveButton"
                                      changedStyleClass="myBoldClass" 
                                      resetFunction="resetInlineEdit"/> 
            </apex:outputfield> 
This code repeats for additional rows and columns.

 Now the Apex class saves the users' checkbox selection; the code:

 

public class VFforEmailTemplateController

{
    public Contact cont { get; set; }
    public ApexPages.StandardController c;

    public VFforEmailTemplateController(ApexPages.StandardController controller)
    {
    this.cont = (Contact)controller.getRecord();
        c = controller;

    }
    public PageReference saveRecord(){
        try{
            c.save();
        }
        catch(Exception e){
        }
        return null;
    }

}

Now, I need your help to determine if the same thing can be implemented in the Pro Edition. After checking it out, my initial thoughts are it may not be possible because you can't create an Apex class.

 

But is there a workaround as far as doing this in Pro? How would you implement the same grid if you only had Pro to work with? Thanks.

 

I have the following Visualforce page in the Contacts page layout:

 

http://i.stack.imgur.com/QfpZV.png

 

 

A single click will toggle the checkbox selection ( as expected) and update the SObject field value. This is all good. However, I want to be able to change the checkbox value on a double-click, not on a single click. Something like how the same custom SObject checkbox behaves when otherwise used directly on the SF page layout (versus on a VF page) would also be nice:

  

http://i.stack.imgur.com/QW29E.png

 

Here is my VF page code for the SObject checkbox:

 

<apex:pageBlock id="theBlock">
<!-- first row -->
    <apex:pageBlockTable value="{!contact}" var="c"> 
         <apex:column headerValue="On Approved List" width="111">
            <apex:inputField value="{!c.EJF_On_Approved__c}"> 
                <apex:actionSupport event="onclick" reRender="theBlock" action="{!saveRecord}"/> 
            </apex:inputfield>
        </apex:column>

 

Suggested changes to the code if provided as complete code would be highly appreciated. Thanks!

How to use scrollbar for pageblocktable

 

Thanks

Hi,

 

I have a custom link titled Download on my Contacts page layout. Clicking this link directly downloads a custom report. I used URL content source to achieve this.

 

The download/export function works fine; however, on clicking download, I auto navigate to a blank page having the following URL in the browser URL bar: ...force.com/servlet/servlet.Integration?lid=00bi00000016M8D&eid=003i000000Bswj8&ic=1

 

I used the following URL in the content source for the Download link and the return functionality doesn't work: /00Oi0000002vZ5W?export=1&enc=ISO-8859-1&xf=xls&retURL=%2F003i000000Bswj8

 

where 003i000000Bswj8 is the Contact record ID that has the custom Download link and is the page to which I would like to redirect (or remain on) after the Download link is clicked. With how the URL works currently, the user has to manually click back on the browser to return to the Contact record.

 

How can I modify the URL so that I remain on the same Contact record instead of staring at the ensuing blank page? If JavaScript is the only solution, I would really appreciate the code pasted here.

 

Hi,

 

Can someone tell me why I do not see "Visualforce Pages" in the edit layout view of Accounts while I can see Visualforce Pages in the same view for Contacts? I can see Fields, Buttons, Custom Links, Related Lists, and Actions but no Visualforce Pages. How can I add a VF page on an Accounts record - I was neatly able to do so on Contacts but not on Accounts cause the option doesn't exist.

 

Thanks.

 

 

I have a visualforce page with standard controller 'contact' and an extension class. This visualforce page appears in a section on each Contacts record page. The page renders several SObject checkboxes. 

 

The issue is when a user clicks the checkbox, the selection is not remembered when the Contacts record page and therefore the VF page section are reloaded. How do I code the VF page so that when the Contact record is opened again, the checkboxes that were checked remain checked?

 

Please help.