• Kate Walsh
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I am working on a VisualForce Email Template.  I want to include our corporate letterhead like we do on our HTML email templates.

I am using the what documentation suggests:
<apex:image id="Logo" value="https://na48.salesforce.com/servlet/servlet.ImageServer?id=0150B000005f9Fm&oid=00DU0000000KJ88MAG" />

and when I run the template instead of the image, I get the following:
<img id="j_id0:emailTemplate:j_id3:j_id4:Logo" src="https://na48.salesforce.com/servlet/servlet.ImageServer?id=0150B000005f9Fm&oid=00DU0000000KJ88MAG" />
The custom button is "Close Work Order" and it mimics the standard SF "Close Case" functionality.  When my user clicks the "Close Work Order" button a VF page is displayed with all the fields that need to be reviewed before the Work Order is "Closed" and the report with the same fields are sent to the customer.  If the button was URL I could set the Order Status picklist field to "Closed."  However. I had to go with a VF page to display the correct fields for User review, but when the VF page is saved they are returned to the the Work Order page/record type they started from.

My question is how can I change the Order Status Picklist to the "Closed" value from whatever status value it had before the button was clicked and corresponding VF page is display?

VF Page code is below...
<apex:page standardController="SVMXC__Service_Order__c"> <apex:sectionHeader title="Work Orders-SM Edit" subtitle="Close Work Orders-SM"/> <apex:form > <apex:pageBlock title="Work Orders-SM Edit" mode="detail"> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="WO Status" columns="1"> <apex:pageBlockSectionItem /> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Order_Status__c}" required="false"/> <apex:pageBlockSectionItem /> </apex:pageBlockSection> <apex:pageBlockSection title="Case/Contact" columns="2"> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Case__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Contact__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Name}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Company__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Billing_Type__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Contact_Phone_number_kw__c}" required="false"/> <apex:pageBlockSectionItem /> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_Contact_s_Email_kw__c}" required="false"/> </apex:pageBlockSection> <apex:pageBlockSection title="Location/Product/Service Assignment" columns="2"> <apex:inputField value="{!SVMXC__Service_Order__c.Location__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Component__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Country__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Product__c}" required="false"/> <apex:pageBlockSectionItem /> <apex:inputField value="{!SVMXC__Service_Order__c.SRV_MAC_ID_S_N__c}" required="false"/> <apex:pageBlockSectionItem /> <apex:pageBlockSectionItem /> <apex:pageBlockSectionItem /> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Group_Member__c}" required="false"/> <apex:pageBlockSectionItem /> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Scheduled_Date_Time__c}" required="false"/> </apex:pageBlockSection> <apex:pageBlockSection title="Evaluation" columns="1"> <apex:inputField value="{!SVMXC__Service_Order__c.Problem_Summery__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Safety_Officer__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Weather_Conditions__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Configuration_Before__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_Equipment_Inspection__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_Communication_Path_Inspection__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_Air_intake__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_Exhaust__c}" required="false"/> </apex:pageBlockSection> <apex:pageBlockSection title="Service" columns="1"> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Work_Performed__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Action_Taken__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.SVMXC__Customer_Failure_Feedback__c}" required="false"/> </apex:pageBlockSection> <apex:pageBlockSection title="Functional Inspection" columns="2"> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_Vac_non_operational__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_AC_Power__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_VDCmpt__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_AC_Energy_kWh__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_Vac_operational__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_Array_Accessible__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WOSM_String_Eval_Subcombiner_Currents__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Irradiance_w_m_2__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_Fan_operation__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Eval_5_minute_UL__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.FC_DMGI960_Master_Heatsink_Temp__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.Departure_Component_Status__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.FC_DMGI960_Slave1_Heatsink_Temp__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.WO_Inverter_Down__c}" required="false"/> <apex:inputField value="{!SVMXC__Service_Order__c.FC_DMGI960_Slave2_Heatsink_Temp__c}" required="false"/> <apex:pageBlockSectionItem /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
I do not need a trigger for it to work in the Sandbox...all I am doing is using SQL to pull the Child Line itmes into an Email Template driven by the Parent RMA Object.

Below is my Apex Class and below that is my VF email template.  It works fine in my sandbox, but the Apex class has 0%code coverage so I cannot movie into Production....I will really appreciate any help

Apex Class (Parts Orders (po) is the master/parent record and PROL are the Detail/Child records (line items) that need to show up in the Parts Order driven email template):

public  class poTemplt
{
    public Id poId {get;set;}
    public List<Parts_Reqs_Orders_Line__c> getpols()
    {
        List<Parts_Reqs_Orders_Line__c> pol;
        pol = [SELECT Id,Name,PROL_Expected_Quantity__c,PROL_Date_Required_By__c,
PROL_Line_Status__c,PROL_Parts_Reqs_Orders__c,PROL_Product_Model__c,PROL_Product_Model__r.name,PROL_Model_Description__c,PROL_Serial_Number__r.SVMXC__Serial_Lot_Number__c,PROL_Serial_Number__c,
PROL_Tracking_Number__c,Related_Case__c,Related_Case__r.CaseNumber 
FROM Parts_Reqs_Orders_Line__c WHERE PROL_Parts_Reqs_Orders__c =: poId];
        return pol;
    }
}

Visualforce Component (VF Component is a list on the Email template with all the line items associated with the RMA's ID:
<apex:component controller="poTemplt" access="global"> <apex:attribute name="PartOdersId" type="Id" description="Id of the Part Order" assignTo="{!poId}"/> <table border = "2" cellspacing = "2"> <tr> <td>RMA Line Number</td> <td>Line Status</td> <td>Related Case</td> <td>Model</td> <td>Model Description</td> <td>Quantity</td> <td>Serial Number</td> <td>Date Required By</td> <td>Tracking Number</td> </tr> <apex:repeat value="{!pols}" var="p"> <tr> <td>{!p.Name}</td> <td>{!p.PROL_Line_Status__c}</td> <td>{!p.Related_Case__r.CaseNumber}</td> <td>{!p.PROL_Product_Model__r.name}</td> <td>{!p.PROL_Model_Description__c}</td> <td>{!p.PROL_Expected_Quantity__c}</td> <td>{!p.PROL_Serial_Number__r.SVMXC__Serial_Lot_Number__c}</td> <td>{!p.PROL_Date_Required_By__c}</td> <td>{!p.PROL_Tracking_Number__c}</td> </tr> </apex:repeat> </table> </apex:component>

I have read through the documentation on Apex testing and most is based on the trigger, but I haven't need a trigger for this fundtionality and I cannot set the Apex Class test up based on the little I have learned from the docuementation.  Please help my users really need this functionality.

Thanks
Kate
 

All

Is question above a known issue?

I am forced to use VFP to pull the data from two related objects Parent/Child (RMA/RMA line items) into the same email template.

I am new to writing the HTML for a VisualForce page (VFP) and it is an email template.  The template is working fine for everything but the Nested Lists and those are working well in GMAIl and Yahooh, but not Outlook.


A sample of the HTML in question:
 <ol type="1">
            
                <li>Package Components for Return Shipment
                    <ol type="a">
                        <li>Pack all returning components and inverters into the packing which the RMA unit shipped in.</li>
                      </ol>
                 </li>
                        
                <li>If the unit shipped by UPS
                    <ol type="a">
                        <li>Locate the return label that was included with the packing slip on the package.  If no label is found email The Returns Department (returns@solectria.com) for replacement label.</li>
                        <li>Affix this new label to the outside of the packaging being sure to cover the original shipping label.</li>
                        <li>Return package to UPS to be shipped to Yaskawa -Solectria Solar.</li>
                     </ol>
                  </li>
                        
               <li>If the unit shipped by truck freight
                    <ol type="a">
                        <li>Secure all parts to the pallet the replacement inverter was sent in.  Record the number of components and number of pallets (if more than one) to be returned to Yaskawa -Solectria Solar.</li>
                        <li>Send the following information to The Returns Department (returns@solectria.com).
                                <ol type="i">
                                      <li>Number of components</li>                              
                                      <li>Number of pallets</li>
                                      <li>Complete address where pallets will be picked up</li>                          
                                      <li>Any shipping/ scheduling restrictions</li>
                                      <li>Please specify if a lift gate is required for pickup</li>
                                    </ol>
In Gmail it comes out as:
1
a
I
In Outlook
1
1
1
Can this be fixed and if so, what is the work around.

thanks
kate
I do not need a trigger for it to work in the Sandbox...all I am doing is using SQL to pull the Child Line itmes into an Email Template driven by the Parent RMA Object.

Below is my Apex Class and below that is my VF email template.  It works fine in my sandbox, but the Apex class has 0%code coverage so I cannot movie into Production....I will really appreciate any help

Apex Class (Parts Orders (po) is the master/parent record and PROL are the Detail/Child records (line items) that need to show up in the Parts Order driven email template):

public  class poTemplt
{
    public Id poId {get;set;}
    public List<Parts_Reqs_Orders_Line__c> getpols()
    {
        List<Parts_Reqs_Orders_Line__c> pol;
        pol = [SELECT Id,Name,PROL_Expected_Quantity__c,PROL_Date_Required_By__c,
PROL_Line_Status__c,PROL_Parts_Reqs_Orders__c,PROL_Product_Model__c,PROL_Product_Model__r.name,PROL_Model_Description__c,PROL_Serial_Number__r.SVMXC__Serial_Lot_Number__c,PROL_Serial_Number__c,
PROL_Tracking_Number__c,Related_Case__c,Related_Case__r.CaseNumber 
FROM Parts_Reqs_Orders_Line__c WHERE PROL_Parts_Reqs_Orders__c =: poId];
        return pol;
    }
}

Visualforce Component (VF Component is a list on the Email template with all the line items associated with the RMA's ID:
<apex:component controller="poTemplt" access="global"> <apex:attribute name="PartOdersId" type="Id" description="Id of the Part Order" assignTo="{!poId}"/> <table border = "2" cellspacing = "2"> <tr> <td>RMA Line Number</td> <td>Line Status</td> <td>Related Case</td> <td>Model</td> <td>Model Description</td> <td>Quantity</td> <td>Serial Number</td> <td>Date Required By</td> <td>Tracking Number</td> </tr> <apex:repeat value="{!pols}" var="p"> <tr> <td>{!p.Name}</td> <td>{!p.PROL_Line_Status__c}</td> <td>{!p.Related_Case__r.CaseNumber}</td> <td>{!p.PROL_Product_Model__r.name}</td> <td>{!p.PROL_Model_Description__c}</td> <td>{!p.PROL_Expected_Quantity__c}</td> <td>{!p.PROL_Serial_Number__r.SVMXC__Serial_Lot_Number__c}</td> <td>{!p.PROL_Date_Required_By__c}</td> <td>{!p.PROL_Tracking_Number__c}</td> </tr> </apex:repeat> </table> </apex:component>

I have read through the documentation on Apex testing and most is based on the trigger, but I haven't need a trigger for this fundtionality and I cannot set the Apex Class test up based on the little I have learned from the docuementation.  Please help my users really need this functionality.

Thanks
Kate