• Qasim Khan
  • NEWBIE
  • 0 Points
  • Member since 2020

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

So I convinced my executive team to triple the annual spend for CRM from what they had to move to salesforce.... no small task. The problem is I’m trying to find a way to do a CSAT survey on case close without added cost... in the sales process I expressed this several times and thought it would be included but I probably didn’t do enough due-diligence. At any rate, has anyone done this successfully on their own without having to buy an add-on?

Hi All

 

I am getting this error when i write the ontabenter function on the tab.

<apex:tab label="Billing" name="billName" id="tabBilling" ontabenter="callCon('Billing');" style="background-color:white;"  rendered="{!IF(strSearchlevel='1',false,true)}">

<apex:outputText value="{!IF(lstDisputeInfo.size>0,'Yes','No')}" label="Account In Dispute" />

 <apex:actionFunction name="callCon" oncomplete="callCon1();">
                        <apex:param name="firstParam" value="" assignTo="{!Tabselected}"/>
                        </apex:actionFunction>

 

Below is the error. when i remove the ontabenter action it is not throwing the error, but i need to write the ontabenter action in order to capture the clicks on the tab. Please let me know your taughts on this.Appreciate your time and help.

 

The value 'null' is not valid for operator '>'

Error is in expression '{!IF(lstDisputeInfo.size>0,'Yes','No')}' in component <apex:outputText> in page summarypage

 

I've modified the Web to Case form on Developerforce Quickstarts Creating Custom Web-To-Case Forms

What I've done is redirect the user to a thankyou page upon pressing the submit button.  But what I really need is for the Casenumber to be shown on the thankyou page. At the moment the casenumber does not show. I have checked the permissions and they are fine. The problem I have is how to pass the value from the first page to the thankyou page. Any help greatly appreciated.

 

Here is my page:

 

<apex:page controller="SubmitCaseController" title="Case thank you page" 
           showHeader="false" standardStylesheets="true">
  <apex:composition template="{!$Site.Template}">
  <apex:insert name="header">
    <c:SiteHeader />
    <hr/>
  </apex:insert>
    <apex:define name="body"> 
        <br/>
        <center>
        <apex:outputText value="Your information is saved.  Thank you for your interest!"/>
        <br/>
        <apex:outputText value="Your Case Reference Number is: {!c.casenumber}"/>
        </center>
        <br/>
        <br/>
    </apex:define>
  </apex:composition>
</apex:page>

 And here is the controller:

 

public class SubmitCaseController {
    
    public Case c { get; set; }
    public SubmitCaseController() {
        c = new Case();
    }
    public string casenum;
       
    
    // This method cancels the wizard, and returns the user to the  
    // Submit case page
    
    public PageReference cancel() {
			PageReference SubmitCasePage = new PageReference('/apex/SubmitCase');
			SubmitCasePage.setRedirect(true);
			return SubmitCasePage; 
    }
    
    public PageReference SubmitCase() {
        List<Contact> cons = [SELECT Id, email, AccountId, CreatedDate FROM Contact WHERE email = :c.SuppliedEmail order by CreatedDate desc];
        if (cons.size() < 1) {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.WARNING, 'Please enter an email that matches our records');
            ApexPages.addMessage(msg);
            return null;
        } else {
            try {
                c.ContactId = cons.get(0).Id;
                c.AccountId = cons.get(0).AccountId;
                
                            
                // Specify DML options to ensure the assignment rules are executed
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.useDefaultRule = true;
                c.setOptions(dmlOpts);

                // Insert the case
                INSERT c;
                
                casenum = c.CaseNumber;             
                
                return new PageReference('/casethankyou');
                } catch (Exception e) {
                ApexPages.addMessages(e);
                return null;
            }
        }
    }
}

 

And here is the SubmitCase page:

 

<apex:page controller="SubmitCaseController" title="Submit Case" showHeader="false"
           standardStylesheets="true">
<script>
  function confirmCancel() {
      var isCancel = confirm("Are you sure you wish to cancel?");
      if (isCancel) return true;
  
     return false;
  }  
  </script>
    
    <apex:composition template="{!$Site.Template}">
    <apex:insert name="header">
    <c:SiteHeader />
    <hr/>
    </apex:insert>
    <apex:define name="body">
    <apex:form >
        <apex:messages id="error"
                   styleClass="errorMsg"
                   layout="table"
                   style="margin-top:1em;"/>
      <apex:pageBlock title="" mode="edit">
        <apex:pageBlockButtons >
           <apex:commandButton value="Submit"
                               action="{!SubmitCase}"/>
           <apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="New Enquiry"
                               collapsible="false"
                               columns="1">
        <table>
            <tr>
                <th>Customer Name:</th>
                <td>
                <apex:inputText required="true" value="{!c.SuppliedName}"/></td>
            </tr>
            <tr>
                <th>Customer Email:</th>
                <td><apex:inputText required="true" value="{!c.SuppliedEmail}"/></td>
            </tr>
            <tr>
                <th>Business Name:</th>
                <td><apex:inputText required="true" value="{!c.SuppliedCompany}"/></td>
            </tr>
            <tr>
                <th>Subject:</th>
                <td><apex:inputText required="true" value="{!c.Subject}"/></td>
            </tr>
            <tr>
                <th>Your Problem:</th>
                <td><apex:inputTextArea required="true" rows="5" value="{!c.Description}"/></td>
            </tr>
         </table>
        
        </apex:pageBlockSection>
     </apex:pageBlock>
   </apex:form>
  </apex:define> 
 </apex:composition>
</apex:page>