• IMU Admin
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 12
    Replies
Hi,

I have an visual force email tempalte however the currency field is giving me some problems: 

  <p> 
                We are writing to advise you that an amount of £{!relatedTo.Amount__c} is outstanding on your account
 </p>

This works ok however if the amount is £200.00 when the email is sent it displays as £200.0

The same thing happens if this is £200.50 it will show as £200.5

It works correctly when the amount is e.g £200.11

Can anybody help? 

Thanks
Hi,

I am trying to add a Visual Force component into a VisualForce email template but keep getting the error message below:

[Error]
Error occurred trying to load the template for preview: Attempt to de-reference a null object. Please try editing your markup to correct the problem.

I do not get any errors when saving class or component. 

Apex Class:

public class InteractionsForCustomer {
    
    
private List<Interactions__c> allInteractions;
        private Interactions__c currentInteractions;
 
    public InteractionsForCustomer() {
         
     }
 
    public List<Interactions__c> getAllInteractions() {
                allInteractions = [Select Id, Name from Interactions__c where Stage__c = 'Open' AND Cutomer__c = :currentInteractions.Customer__c];
        return allInteractions;
    }
 
     public Interactions__c getcurrentInteractions() {       
             return currentInteractions;
     }
     public void setcurrentInteractions(Interactions__c val) {
            this.currentInteractions = val;     
      }
}

VisualForce Component

<apex:component controller="InteractionsForCustomer" access="global">
    <apex:dataTable value="{!allInteractions}" var="inv">
        <apex:column >
            <apex:facet name="header">Invoice Name</apex:facet>
            {!inv.Customer__c}
        </apex:column>
    </apex:dataTable>
</apex:component>

Can anybody help??

Thanks
Josh
Hi All,

I need some help writing a test class for the below (I am fairly new to apex so still learning)

Apex Class:

public class InteractionsForCustomer {
    
    
private List<Interactions__c> allInteractions;
        private Interactions__c currentInteractions;
 
    public InteractionsForCustomer() {
         
     }
 
    public List<Interactions__c> getAllInteractions() {
                allInteractions = [Select Id, Name from Interactions__c where Stage__c = 'Open' AND Cutomer__c = :currentInteractions.Customer__c];
        return allInteractions;
    }
 
     public Interactions__c getcurrentInteractions() {       
             return currentInteractions;
     }
     public void setcurrentInteractions(Interactions__c val) {
            this.currentInteractions = val;     
      }
}

VisualForce Component

<apex:component controller="InteractionsForCustomer" access="global">
    <apex:dataTable value="{!allInteractions}" var="inv">
        <apex:column >
            <apex:facet name="header">Invoice Name</apex:facet>
            {!inv.Customer__c}
        </apex:column>
    </apex:dataTable>
</apex:component>

Thanks
Josh
Hi,

I am trying to add a table with the related child records into a visual force email template.

The email template is is on the child object so I need the table to show all the related child records attached to the parent record. 

Both are custom objects does anybody know if this is possible and if so please assist
 

Thanks
 

Josh
Hi,

I have created a visual force email template which creates and attachs the PDF to the email however I cant seem to save the PDF as an attachment on the record. 

Is this possible? 

Thanks

Josh
Hi,

I am working through the Apex Workbook for Spring 15.

I have followed each step but seem to get the below error message when executing the request:

Line: 1, Column: 19
Constructor not defined: [Fridge].<Constructor>(String, Integer)

I have the following code within the Class:

public class Fridge {
private String modelNumber;
private Integer numberInStock;

    public void updateStock (integer justSold) {
        numberInStock = numberInStock - justSold;
    }
    public void setModelNumber (String theModelNumber){
        modelNumber = theModelNumber;
    }
    public String getModelNumber (){
        return modelNumber;
    }
 public Fridge() {
 modelNumber = 'XX-XX';
 numberInStock = 0;
}
   
   
 public Fridge(String theModelNumber, Integer theNumberInStock) {
 ModelNumber = theModelNumber;
 numberInStock = theNumberInStock;
}

Can anyone help me out please?

Thanks

Josh
Hi All,

I need some help writing a test class for the below (I am fairly new to apex so still learning)

Apex Class:

public class InteractionsForCustomer {
    
    
private List<Interactions__c> allInteractions;
        private Interactions__c currentInteractions;
 
    public InteractionsForCustomer() {
         
     }
 
    public List<Interactions__c> getAllInteractions() {
                allInteractions = [Select Id, Name from Interactions__c where Stage__c = 'Open' AND Cutomer__c = :currentInteractions.Customer__c];
        return allInteractions;
    }
 
     public Interactions__c getcurrentInteractions() {       
             return currentInteractions;
     }
     public void setcurrentInteractions(Interactions__c val) {
            this.currentInteractions = val;     
      }
}

VisualForce Component

<apex:component controller="InteractionsForCustomer" access="global">
    <apex:dataTable value="{!allInteractions}" var="inv">
        <apex:column >
            <apex:facet name="header">Invoice Name</apex:facet>
            {!inv.Customer__c}
        </apex:column>
    </apex:dataTable>
</apex:component>

Thanks
Josh
Hi,

I am trying to add a table with the related child records into a visual force email template.

The email template is is on the child object so I need the table to show all the related child records attached to the parent record. 

Both are custom objects does anybody know if this is possible and if so please assist
 

Thanks
 

Josh
Hi,

I am working through the Apex Workbook for Spring 15.

I have followed each step but seem to get the below error message when executing the request:

Line: 1, Column: 19
Constructor not defined: [Fridge].<Constructor>(String, Integer)

I have the following code within the Class:

public class Fridge {
private String modelNumber;
private Integer numberInStock;

    public void updateStock (integer justSold) {
        numberInStock = numberInStock - justSold;
    }
    public void setModelNumber (String theModelNumber){
        modelNumber = theModelNumber;
    }
    public String getModelNumber (){
        return modelNumber;
    }
 public Fridge() {
 modelNumber = 'XX-XX';
 numberInStock = 0;
}
   
   
 public Fridge(String theModelNumber, Integer theNumberInStock) {
 ModelNumber = theModelNumber;
 numberInStock = theNumberInStock;
}

Can anyone help me out please?

Thanks

Josh