• craigt_rcse
  • NEWBIE
  • 10 Points
  • Member since 2009

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

Hi Everyone,

I am very new to apex development and I'm hoping one of you can help.   I'm trying to create a controller that is using what I believe (or hope) is a simple query.   I'm attempting to use the case ID to retrieve a list of  related records from a custom object that is related to cases.  However when I execute the code as it appears below, I get zero (0) records. But, if I hard code a 18-digit ID in query statement, the controller works exactly as I want it to.  I suspect the problem has something to do with comparing 18-digit object ID's with 15-digit ID's but I'm not sure how to fix this or this is the actual problem. Can someone tell me what I'm doing wrong?  

My code is below.

 

 

public class mycustomController {
    //capture the case id
    public Id thisCaseId {get;set;}
    //a list to hold the customer objects for this case
    public List<custom_object__c> thesecobjects = new List<custom_object__c>();
    //get the custom objects into the list
    public List<custom_object__c> getthesecobjects() {
        //criteria for the custom objects
        thesecobjects = [Select ID , Name, Case__r.Id, Case__r.CaseNumber FROM custom_object__c WHERE ID =: thisCaseId  
                        ORDER BY Case__c DESC LIMIT 10];
        return thesecobjects;
    }
}

 

Hello Everyone,

I've successfully created a tabbed view for several objects using code I found on the discussion boards.  Thanks to all those who contributed to that.  Now I want to continue with my customization by creating tabs for the layout sections found in the standard layouts.  

Is there an apex component or other method for referring to and using an entire layout section with its fields? 

For example, our case layout contains several sections such as ‘basic information’, ‘product information’, ‘contact information’, etc.  Each of these layout sections contains a number of varying fields.  I’d want to create tabs for these sections and am hoping  there is a component or code snippet that will let me add the entire section (including the fields contained in that section) to a tab without having to build the tab, page block sections, fields, etc. from scratch.

 

I've create a tabbed account view page in visualforce.  I'm able to create tabs for all of the related lists except for Account History.   I've tried using related entity history and account history but keep getting '....' is not a valid child relationship name for entity Account .

Can someone help me figure this out. 

 My code is below.  The red text is the problem area.

  

<apex:page standardController="Account" showHeader="true"
           tabStyle="account" >
   <apex:tabPanel switchType="client"
                  selectedTab="tabdetails"
                  id="AccountTabPanel">
      <apex:tab label="Details" name="AccDetails" id="tabdetails">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts" />
      </apex:tab>
      <apex:tab label="Entitlements" name="Entitlement" id="tabEnt">
         <apex:relatedList subject="{!account}" list="entitlements" />
      </apex:tab>
      <apex:tab label="Cases" name="Cases" id="tabCase">
         <apex:relatedList subject="{!account}" list="cases" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct">
         <apex:relatedList subject="{!account}" list="OpenActivities" />
      </apex:tab>

      <apex:tab label="Activity History" name="ActivityHistory" id="tabActHist">
         <apex:relatedList subject="{!account}" list="ActivityHistories" />
      </apex:tab>          
      <apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}" list="NotesAndAttachments" />
      </apex:tab>
     
      <apex:tab label="Account History" name="AccountHistory" id="tabAcctHistory">
         <apex:relatedList subject="{!account}" list="AccountHistories"
/>
      </apex:tab>

 

   </apex:tabPanel>
</apex:page>

I've created a page that is loaded when users click a new custom button.

I want the value of the task.status field to be set to 'Complete' when the button is clicked and before the page is loaded.  I can't figure this out.

How do make the value of {!Task.status} equal to 'Complete' when the page is loaded?

Any help would be appreciated.

Hi,

 

We would like to reset the entitlement countdown time when a case is set in status "On Hold" and then put in "In progress" again. Time should stop counting when put in "On Hold" and then restart when not "On Hold".

 

I have set up Milestones, entitlement process and entitlements that are linked to Accounts and cases. Everything works fine.

I think that it is the "Case enters the process" and "Case exits the process" that is the key to set this up?

 

Any ideas on how to configure those so that the process restarts on "On Hold" status change?

I've create a tabbed account view page in visualforce.  I'm able to create tabs for all of the related lists except for Account History.   I've tried using related entity history and account history but keep getting '....' is not a valid child relationship name for entity Account .

Can someone help me figure this out. 

 My code is below.  The red text is the problem area.

  

<apex:page standardController="Account" showHeader="true"
           tabStyle="account" >
   <apex:tabPanel switchType="client"
                  selectedTab="tabdetails"
                  id="AccountTabPanel">
      <apex:tab label="Details" name="AccDetails" id="tabdetails">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts" />
      </apex:tab>
      <apex:tab label="Entitlements" name="Entitlement" id="tabEnt">
         <apex:relatedList subject="{!account}" list="entitlements" />
      </apex:tab>
      <apex:tab label="Cases" name="Cases" id="tabCase">
         <apex:relatedList subject="{!account}" list="cases" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct">
         <apex:relatedList subject="{!account}" list="OpenActivities" />
      </apex:tab>

      <apex:tab label="Activity History" name="ActivityHistory" id="tabActHist">
         <apex:relatedList subject="{!account}" list="ActivityHistories" />
      </apex:tab>          
      <apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}" list="NotesAndAttachments" />
      </apex:tab>
     
      <apex:tab label="Account History" name="AccountHistory" id="tabAcctHistory">
         <apex:relatedList subject="{!account}" list="AccountHistories"
/>
      </apex:tab>

 

   </apex:tabPanel>
</apex:page>