• hy.lim1.3897974166558203E12
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 9
    Likes Received
  • 1
    Likes Given
  • 42
    Questions
  • 21
    Replies
Hi, i have created a visualforce page with page navigation. I am able to shows the records but when i click next nothing happen. below is my controller:

public class sampleOutput5Cases {
    private List<Case> ca;
    private Contact cntact;
    public ApexPages.StandardSetController setController{get; set;}
     
    public sampleOutput5Cases (ApexPages.StandardController controller) {
        this.cntact= (Contact)controller.getRecord();
    }
    
    public List<Case> getCa()
    //public void getCa()
    {       
        ca = [Select id, CaseNumber, Origin, Status, Subject from Case where ContactId = :cntact.id];
        
        setController = new ApexPages.StandardSetController(ca); 
        setController.setPageSize(10);
        renderTable = true;
        
        return (List<Case>)setController.getRecords();
        //return ca;
        
    }
    
    public Boolean renderTable {
        get{
            if(renderTable == null)
                return false;
            return renderTable;
            
        }
        set;
    }
    
    public void Next()
    {
        setController.Next();
    }
    
    public void Previous()
    {
        setController.Previous();
    }
    
    /*public ApexPages.StandardSetController setController
    {
        get
        {   
            if(cntact == null){
                List<Case> caseList = new List<Case>();
                return new ApexPages.StandardSetController(caseList);
            }else
            
            return setController;
            
        }
        set;
    }*/
   
    public Boolean getHasNext()
    {
        if(setController==null)
            return false;
        return setcontroller.getHasNext();
    }
 
    public Boolean getHasPrevious()
    {
        if(setController==null)
            return false;       
        return setcontroller.getHasPrevious();
    }
   
    public String getPageRangeText()
    {
        if(setController == null)
            return '';
        else
        {
            Integer startP = ((setController.getPageNumber() - 1) * setController.getPageSize()) + 1;
            Integer endP;
            if(setController.getPageNumber()*setController.getPageSize() > setcontroller.getResultSize())
                endP = setcontroller.getResultSize();
            else
                endP = setController.getPageNumber()*setController.getPageSize();
            return 'Showing Records : ' + startP + ' - ' + endP + ' of total ' + setcontroller.getResultSize();
        }
    }
   
 
    public Boolean getShowPageRangeText()
    {
        if (setController==null)
            return false;       
        if(setcontroller.getResultSize() > 0)
            return true;
        else
            return false;
    } 
    
    
    
}

and my VF page:

<apex:page standardController="Contact" extensions="sampleOutput5Cases">
     
     
    <apex:includeScript value="/support/console/29.0/integration.js"/>
    <script type="text/javascript">
     
        // Opens a subtab when a related Case Number is clicked
      function OpenNewCaseDetailTab(theId, name) {
       sforce.console.openPrimaryTab(null, '/' + theId, true, name );
    }
     </script>
  
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockTable value="{!ca}" var="oCase" >
          <apex:column headerValue="CaseNumber" >
              <a HREF="#" onClick="OpenNewCaseDetailTab('{!oCase.Id}','{!oCase.CaseNumber}')" >{!oCase.CaseNumber}</a>
              <!--apex:commandLink value="{!oCase.CaseNumber}" action="/{!oCase.Id}" target="_blank"/-->
              <!--apex:commandlink style="margin-left:0px;color:#000;font-size:11px;" onclick="openPrimaryTab();return false;" value="{!oCase.CaseNumber}" /-->
          </apex:column>
          <apex:column value="{!oCase.Subject}"/>
          <apex:column value="{!oCase.Origin}"/>      
         <apex:column value="{!oCase.Status}"/>      
 </apex:pageBlockTable>
 </apex:pageBlock>
 <apex:commandButton id="btnPrev" value="Prev" action="{!Previous}" rendered="{!HasPrevious}" />
    <apex:commandButton id="btnNext" value="Next" action="{!Next}" rendered="{!HasNext}" />
    <br />
    <br />
    <apex:outputLabel id="opPageRangeText" styleClass="brandTertiaryBgr pbSubheader tertiaryPalette" rendered="{!ShowPageRangeText}" value="{!PageRangeText}" />
 </apex:form>
     
    
</apex:page>

Hi,
It seems like no matter where I put my System.debug statement, I cannot find it in my debug log. I have already set myself up to track debug logs, etc, but for some reason I can only see the debug log at the end of my Apex class.

What reasons would there be for not being able to see the system.debug statements in a debug log? I already have the appropriate setting and can see the debug log, but it does not contain the debug statements I need. Please advise
Hi i have a simple table need to add to Contact object which will show top 5 cases from that contact sort by case number.

i need to create a visualforce page table to display 4 columns:

1) Case Number
2) Case Subject
3) Origin
4) Status

I wanted the Case Number to be clickable meaning if i click on the case number it will direct me to the case details

any suggestion?
Hi i have a trigger in my custom object and it hit governor limit due to select statment in my for loop. now i would like to move my statement out. can anyone help? here is my trigger:

trigger CalculateMorgage on Property__c (before insert) {
   
   for(Property__c pp: Trigger.new){        
        List <House_Type__c> ht = [SELECT ID, Property_Type__c  FROM House_Type__c WHERE Range__c =: pp.range__c and Quantity__c =: pp.p_quantity__c];

     if(!ht.isempty()){
          for(House_Type__c htt:ht){
                 pp.type__c = htt.Property_Type__c ;
           }         
     }
    }

}



 Hi i have a very simple email publisher to replace the original one :->

<apex:page standardController="Case" >
  <apex:emailPublisher entityId="{!case.id}" 
      fromVisibility="selectable"
      subjectVisibility="readOnly" 
      toVisibility="readOnly"
      fromAddresses="support@abc.com}"
      emailBody=""/>
      
</apex:page>
So i remove the standard 'Answer Customer' action and add in my custom emailpublisher in. Now all my email message record feed doesn't have the 'Reply' & 'Reply to All' button. What have i missed out? Basically what I want to achieve is I want the sender to default as our support email instead of user's personal email.

With Answer Customer Action
User-added image


Without Answer Customer action (replaced with my custom email publisher)
User-added image

Hi I am trying to insert Contact from a .csv file using data loader and I found that the birthdate imported has the original birthdate - 1 day

In my csv file, the birthdate is 2009-09-10 but when imported to Salesforce, the birthdate become 2009-09-09 under the new contact. Any reason why?

Thanks.
Hi, I have a simple report and I would like to know how can I convert a number column into time format (hh:mm:ss)?

I have a column (number) that is calculated in mins and I would like to show as time format (hh:mm:ss) in my report instead of whole number.

For example,
- 45 will show 00:45:00,
- 65 will show 01:05:00

is there any formula rules in report can do this?

Hi i have a Email-to-Salesforce enabled and will save attachment for every email in activity history. Now i would like query back the attachment but it return 0 result. My trigger as below: 

Trigger TestAtchfromTask on Task (after insert) {
   
    for(Task tk:Trigger.new){
       
        List<Attachment> atch = [select Id, Name, Body, BodyLength from Attachment where ParentId =: tk.id];
       
        System.debug('attachment >> ' + atch);
   
    }


Hi, I have a custom button which will send a SingleEmailMessage and below is my SingleEmailMessage code

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new string[] {'userA@support.com'});
mail.setCcAddresses(new string[] {'CC_User@support.com'});
mail.setSubject('Testing Subject');
mail.setPlainTextBody('Testing Body');
mail.setReplyTo('UserB@support.com');
mail.setSenderDisplayName(UserInfo.getUserEmail());
Messaging.SendEmailResult[] res = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

Everything works fine but can I not to send this email to user under CcAddresses?

I wan userA to receive the email but not CC_User, so when userA pick up the email and reply, he will see reply To UserB@support.com and CC to CC_User@support.com

Thanks
Hi I have a custom report (Activities with Case) created like this ->

User-added image

Now I would like to add an additional column and value would be 'Email - Received' - 'Email - Sent'. Possible to do that? 
Hi, according to statement here ->

"If you use a company-provided or third-party email account, you can use Email to Salesforce to assign emails to leads, contacts, opportunities, and other records in Salesforce."

Now I would like to add email from Outlook to Case record instead of Contact/Lead/Opportunity. How can I do that?

I BCC the email address generated by Salesforce but it didn't work.

How can I add the email to Case?
Hi, I would like to know how can I migrate/mimic one org to another org?

Says I have 1 org (org A) with some custom fields on cases and the page layout was edited and I have another new org (org B) which is all standard, never edit before. Now I want the org B to have the same case layout & field from my org A.

I tried use Eclipse -Salesforce IDE to migrate and it give me errors something like -> 'Booking value is missing'. In my org A I have additional value for Case Type field, 'Booking' is one of it.

When I migrate from org A to org B, wouldn't it auto insert those new value for me? I have to ensure all value in org A is present in org B then only I can migrate from org A to org B?

Or is there other best practice to do org migration?

Thanks.
i have a trigger that will update a custom date/time field in my case but it seems like not working

This is my trigger:

c.SLA_Cont_Time__c = System.now() - c.SLA_Days_mins__c;

c.SLA_Cont_Time__c is my custom date/time field and c.SLA_Days_mins__c is a numeric field that i need to minus it to get latest value. but my c.SLA_Cont_Time__c keep getting the System.now() value instead. why it will not take the after subtraction value?

anything wrong?
Hi, how can i default a dependent picklist value if there is only one value?

for example, i have controling picklist value of A,B,C and dependent picklist value of 1,2,3,6,7,8

A - 1,2,3
B - 6
C - 7,8

so when i select B my dependent picklist will automatically show 6 instead of None and need to choose again since there is only onle value there.
Hi, I have article knowledge enabled in my org and I would like to do some restriction that some users only able to see certain articles by category.

I have created a few category group and my 'Default Visibility Settings' set to None but my standard user still able to see published article.

Thanks.

I am trying to add a chatter component to a VF page, but am having some difficulties.  I have been able to successfully create a vf page that displays a Chatter Group feed, using the following:

 

<apex:page standardController="MyCustomObject__c" sidebar="false" showheader="false" >
  <Chatter:feed entityID="{!MyCustomObject__c.Group_ID__c}" / >
  </apex:page>

 

I would also like to render the follow/unfollow (join/leave) button for the group.  According to Salesforce's documentation, there is a <chatter:follow> component which should do this.  If I follow the same logic as my previous example (if group feed is simply a record feed, then group join would logically be the same as record follow).  When I try the following I am unable to get the button to render:

 

<apex:page standardController="MyCustomObject__c" sidebar="false" showheader="false" >
  <Chatter:follow entityID="{!MyCustomObject__c.Group_ID__c}" / >
  </apex:page>

 

However, if I replace "{!MyCustomObject__c.Group_ID__c}" with the ID of a users profile or record, the follow button appears.  So it seems that groups are only like records when it comes to feeds, not following or joinging.

 

Does anyone know how I can add the Join/Leave button for a Chatter Group (public) on a VF page, as I was able to add the group feed? 

 

 

One other option I was considering was to embed the Chatter Group Profile Page on the VF page, however this VF page is going to be included on the page layout of one of our custom objects.  When I try this, it includes the standard Salesforce header and top navigation in the iframe.  It also includes the left column of the group page which includes the group image and description and becomes quite busy.  Here is the coded I used

 

<apex:page standardController="MyCustomObject__c" showheader="false">
  <apex:iframe src="https://cs14.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g="{!MyCustomObject__c.Group_ID__c}" scrolling="true" id="theIframe"/>
     </apex:page>

 

I was able to remove the standard Salesforce header and top navigation by adding $isdtp-vw to the URL.  Here is the code: 

<apex:page standardController="MyCustomObject__c" showheader="false">
  <apex:iframe src="https://cs14.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g="{!MyCustomObject__c.Group_ID__c}&isdtp=vw" scrolling="true" id="theIframe"/>
     </apex:page>

 

Unfortunately, it seems that the isdtp UNSUPPORTED by Salesforce. I also have not been able to get the EntityID reference ({!MyCustomObject__c.Group_ID__C}) in the URL to pick up the ID from the record the VF page is displayed on.  It works if I have the exact ID included in the URL (not ideal, but workable in this situation)

 

I would really like a VF page that:

  • 1st choice: a VF page that inlcudes the group feed (including the bar where you can post/file/link/poll/share, as well as the button to join or leave the group.  (so basically the center column of the standard group profile page, plus the join/leave button, without the standard salesforce header)
  • 2nd choice: If neccessary, it would be acceptable to include the right column of the standard group profile page, which includes the join/leave button, members list and group files list. 
  • last choice: would be to include the entire group profile page, without the standard salesforce headers through a supported method.

This VF page would be added to the page layout of a custom object.  This custom object would have a field that would contain the ID of the group that should be displayed/reference in the VF page.  I would prefer the reference the Group ID on the custom object, versus having to have multiple VF pages for each group.

 

Any insights would be greatly appreciated

Michele

I am trying to create a Date of Birth field. Whether you are using a VF page or a regular page layout, when you use the calendar in Salesforce, it only lets you pick from years going forward. So the calendar is useless for something like a Date of Birth since obviously the year is before this year. Obviously the user can type the date, but is there any other way to adjust how the calendar behaves.