• Neal Lightfeldt
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
We have launched a new website with a form for the user to submit a technical request. In the past I generated the form using Web-to-Case, set up a queue, autoresponse, etc. 

The web developer is using Drupal to create the forms in send to Salesforce. I created everything to recieve the data in a Case, but nothing seems to work in terms of autoresponse and being able to reply to the customer's email through the Case. 

My question: if we are using an outside web form, can we still set up auto-response to the customer and communicate through email within the Case? Or will that only work if I use the Web-to-Case funtionality?
I am adding "*/" at line 141 just above the last two brackets and I get this error: "Error: Compile Error: Expecting '}' but was: '*' at line 141 column 9"

Here's the code:

/*
*   Crane Barksdale Sandbox 
*   Created : 8-NOV-2012  
*   
*
*/
public with sharing class CallPlanner_detailcontroller 
{
 
 /*
    public string mutualpyramid{get;set;}
    public string customer{get;set;}
    public List<Event>lstEvent{get;set;}
    public boolean isEvent{get;set;}
    public final Call_Planner_2__c cplan;

    public CallPlanner_detailcontroller(ApexPages.StandardController ctlr)
    {
        
        mutualpyramid = '';
        customer= '';        
        customer = system.label.Customer_Needs; // image Link
        mutualpyramid = system.label.Mutual_Pyramid; // image Link
        isEvent = false;
        lstEvent = new List<Event>();
        
        try
        {
            //Get related events for this Call planner
            integer iCount = [  select count() 
                                from event 
                                where whatid = :ctlr.getId()
                             ];
    
    
    
            if (iCount != 0)
            {
                isEvent = true;
            }
            else 
            {
                this.cplan = (Call_Planner_2__c)ctlr.getRecord();
                if (cplan.event__c == '' || cplan.event__c == null) 
                {
                    isEvent = false;
                } 
                else 
                {
                    lstEvent = [    select id 
                                    from event 
                                    WHERE Id = :cplan.event__c
                                ];
                                
                    if (!lstEvent.isEmpty()) 
                    {
                        isEvent = true;
                    } 
                    else 
                    {
                        isEvent = false;
                    }
                }
            }
        }
        catch(Exception ex)
        {
            System.Debug(ex);
        }
    }

/**************************
Test Method
**************************/

static testMethod void myUnitTest1() {
        
        
        
        //creating Account
        Account objAcc = new Account();
        objAcc.Name='test';
        
        //objAcc.Market_Code__c='910-china';//commented for migration on 3rd may
        //objAcc.District__c='413-Nancy Rapp';//commented for migration on 3rd may
        insert objAcc;
        
        //Creating Contact
        Contact objcon= new Contact();
        objcon.AccountId = objAcc.id;
        objcon.LastName='test';
        objcon.FirstName='test';
        //objcon.Business_Phone_1__c='5555555555';
        insert objcon;
        
        //creating Opportunity
        Opportunity objopp= new Opportunity();
        objopp.AccountId =objAcc.id;
        objopp.Name = 'test';
        objopp.Type='simple';
        objopp.StageName='Universe';
        objopp.CloseDate=system.today();
        //objopp.Product__c = 'test';
        
        //objopp.Price_Target__c=578; //commented for migration frm sand to sand on 3rd may
        
        insert objopp;
        
        //creating Event 
        Event objevent = new Event();
        //objevent.AccountId =objAcc.Id;
        objevent.WhatId =objAcc.Id;
        objevent.Subject ='Email';
        objevent.StartDateTime=system.today();
        objevent.EndDateTime=system.today();
        insert objevent; 
        
        //creating Call_Planner
        Call_Planner_2__c objclp = new Call_Planner_2__c();
        objClp.Contact__c =objcon.Name;
        objClp.Call_Objective__c = 'test';
        objClp.Opportunity__c = objopp.id;
        insert objClp;
        ApexPages.StandardController c = new Apexpages.StandardController(objclp);
        CallPlanner_detailcontroller objdetail = new CallPlanner_detailcontroller(c);
        
        objClp.event__c = objevent.id;
        update objClp;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);
        
        objevent.whatid = objClp.id;
        update objevent;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);

        delete objevent;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);
        
        */
        
              }

}
I am getting these Apex Test Failures when validating an inbound change set in production. None of these have to do with the app I am moving from Sandbox. I have zero knowledge of Apex and I just want to know what I have to do to resolve these errors. Can anyone help?User-added image
My Change Set is failing because I didn't include a trigger. When I look at Apex triggers I see it, but when I go to Change set to add it, it isn't visible. Any idea why?
User-added imageUser-added image
I'm trying to create a VF email template that will display line items from a related list. I am completely new to VF and although I've got the basics right below, I know I'm missing a few things. 

I have two custom objects. "Price_Approval__c" is the parent, "Price_Approval_Details__c" is the child (screenshot below).
Below is VF markup (basically stolen from elsewhere). I have traveled various forums/help files and still feel no closer to making this work:
<messaging:emailTemplate subject="New price request approval required" recipientType="Contact"
relatedToType="Price_Approval_Details__c">
<messaging:htmlEmailBody >
<html>
    <body>
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align:
center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<p>Dear {!recipient.name},</p>
<p>Below is a list of line items included in this Price Approval Request: {!relatedTo.name}.</p>
<table border="0" >
    <tr >
        <th>Action</th><th>Part No</th><th>List Price</th><th>Sell Price</th><th>Margin</th>
    </tr>
    <apex:repeat var="cx" value="{!relatedTo.Price_Approval__c.Price_Approval_Details__r}">
        <tr>
            <td><a href="https://cs78.salesforce.com/{!cx.id}">View</a> | 
            <a href="https://cs78.salesforce.com/{!cx.id}/e">Edit</a></td>
            <td>{!cx.Part_No__c}</td>
            <td>{!cx.List_Price__c}</td>
            <td>{!cx.Sell_Price__c}</td>
            <td>{!cx.Margin__c}</td>
        </tr>
    </apex:repeat>                
</table>
<p />
</font>
 </body>
 </html>


</messaging:htmlEmailBody>
</messaging:emailTemplate>

Here is the actual page:

User-added image
Module number two, I keep getting this error when I run the challenge: "Challenge Not yet complete... here's what's wrong: 
The page does not have the 'showHeader' attribute set to false"

The attribute is set to false, but I keep getting the error.
I am adding "*/" at line 141 just above the last two brackets and I get this error: "Error: Compile Error: Expecting '}' but was: '*' at line 141 column 9"

Here's the code:

/*
*   Crane Barksdale Sandbox 
*   Created : 8-NOV-2012  
*   
*
*/
public with sharing class CallPlanner_detailcontroller 
{
 
 /*
    public string mutualpyramid{get;set;}
    public string customer{get;set;}
    public List<Event>lstEvent{get;set;}
    public boolean isEvent{get;set;}
    public final Call_Planner_2__c cplan;

    public CallPlanner_detailcontroller(ApexPages.StandardController ctlr)
    {
        
        mutualpyramid = '';
        customer= '';        
        customer = system.label.Customer_Needs; // image Link
        mutualpyramid = system.label.Mutual_Pyramid; // image Link
        isEvent = false;
        lstEvent = new List<Event>();
        
        try
        {
            //Get related events for this Call planner
            integer iCount = [  select count() 
                                from event 
                                where whatid = :ctlr.getId()
                             ];
    
    
    
            if (iCount != 0)
            {
                isEvent = true;
            }
            else 
            {
                this.cplan = (Call_Planner_2__c)ctlr.getRecord();
                if (cplan.event__c == '' || cplan.event__c == null) 
                {
                    isEvent = false;
                } 
                else 
                {
                    lstEvent = [    select id 
                                    from event 
                                    WHERE Id = :cplan.event__c
                                ];
                                
                    if (!lstEvent.isEmpty()) 
                    {
                        isEvent = true;
                    } 
                    else 
                    {
                        isEvent = false;
                    }
                }
            }
        }
        catch(Exception ex)
        {
            System.Debug(ex);
        }
    }

/**************************
Test Method
**************************/

static testMethod void myUnitTest1() {
        
        
        
        //creating Account
        Account objAcc = new Account();
        objAcc.Name='test';
        
        //objAcc.Market_Code__c='910-china';//commented for migration on 3rd may
        //objAcc.District__c='413-Nancy Rapp';//commented for migration on 3rd may
        insert objAcc;
        
        //Creating Contact
        Contact objcon= new Contact();
        objcon.AccountId = objAcc.id;
        objcon.LastName='test';
        objcon.FirstName='test';
        //objcon.Business_Phone_1__c='5555555555';
        insert objcon;
        
        //creating Opportunity
        Opportunity objopp= new Opportunity();
        objopp.AccountId =objAcc.id;
        objopp.Name = 'test';
        objopp.Type='simple';
        objopp.StageName='Universe';
        objopp.CloseDate=system.today();
        //objopp.Product__c = 'test';
        
        //objopp.Price_Target__c=578; //commented for migration frm sand to sand on 3rd may
        
        insert objopp;
        
        //creating Event 
        Event objevent = new Event();
        //objevent.AccountId =objAcc.Id;
        objevent.WhatId =objAcc.Id;
        objevent.Subject ='Email';
        objevent.StartDateTime=system.today();
        objevent.EndDateTime=system.today();
        insert objevent; 
        
        //creating Call_Planner
        Call_Planner_2__c objclp = new Call_Planner_2__c();
        objClp.Contact__c =objcon.Name;
        objClp.Call_Objective__c = 'test';
        objClp.Opportunity__c = objopp.id;
        insert objClp;
        ApexPages.StandardController c = new Apexpages.StandardController(objclp);
        CallPlanner_detailcontroller objdetail = new CallPlanner_detailcontroller(c);
        
        objClp.event__c = objevent.id;
        update objClp;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);
        
        objevent.whatid = objClp.id;
        update objevent;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);

        delete objevent;
        c = new Apexpages.StandardController(objclp);
        objdetail = new CallPlanner_detailcontroller(c);
        
        */
        
              }

}
I am getting these Apex Test Failures when validating an inbound change set in production. None of these have to do with the app I am moving from Sandbox. I have zero knowledge of Apex and I just want to know what I have to do to resolve these errors. Can anyone help?User-added image
I'm trying to create a VF email template that will display line items from a related list. I am completely new to VF and although I've got the basics right below, I know I'm missing a few things. 

I have two custom objects. "Price_Approval__c" is the parent, "Price_Approval_Details__c" is the child (screenshot below).
Below is VF markup (basically stolen from elsewhere). I have traveled various forums/help files and still feel no closer to making this work:
<messaging:emailTemplate subject="New price request approval required" recipientType="Contact"
relatedToType="Price_Approval_Details__c">
<messaging:htmlEmailBody >
<html>
    <body>
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align:
center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<p>Dear {!recipient.name},</p>
<p>Below is a list of line items included in this Price Approval Request: {!relatedTo.name}.</p>
<table border="0" >
    <tr >
        <th>Action</th><th>Part No</th><th>List Price</th><th>Sell Price</th><th>Margin</th>
    </tr>
    <apex:repeat var="cx" value="{!relatedTo.Price_Approval__c.Price_Approval_Details__r}">
        <tr>
            <td><a href="https://cs78.salesforce.com/{!cx.id}">View</a> | 
            <a href="https://cs78.salesforce.com/{!cx.id}/e">Edit</a></td>
            <td>{!cx.Part_No__c}</td>
            <td>{!cx.List_Price__c}</td>
            <td>{!cx.Sell_Price__c}</td>
            <td>{!cx.Margin__c}</td>
        </tr>
    </apex:repeat>                
</table>
<p />
</font>
 </body>
 </html>


</messaging:htmlEmailBody>
</messaging:emailTemplate>

Here is the actual page:

User-added image