+ Start a Discussion
sam_Adminsam_Admin 

Help on VF page and query

Hi,

   can i get the link open in new tab when i click on the case number right now it opens in the sametab but i want it to open up in other tab , here is my code

 

 <apex:column headervalue="Case Number">
            <apex:outputlink value="/{!c.Id}" >
            <apex:outputtext value="{!c.CaseNumber}"/>
            </apex:outputlink>
   </apex:column>

 

In the below query i want the results to be shown order by ownername and then the Estimation complete date right now it's only by Estimation complete date and idk how to order by both , any help?

 

if(para1=='Sam/Sam1/Sam2')
         return [select CaseNumber,Status,owner.name,subject,Estimated_Completion_Date__c,Complete__c,ClosedDate from Case
                 where ClosedDate = LAST_N_DAYS:7 and (owner.name ='Sam' OR owner.name ='Sam1' OR owner.name ='Sam2') order by Estimated_Completion_Date__c asc];

 

TIA!       

Best Answer chosen by Admin (Salesforce Developers) 
sai.sfsai.sf

if(para1=='Sam/Sam1/Sam2')
         return [select CaseNumber,Status,owner.name,subject,Estimated_Com

pletion_Date__c,Complete__c,ClosedDate from Case
                 where ClosedDate = LAST_N_DAYS:7 and (owner.name ='Sam' OR owner.name ='Sam1' OR owner.name ='Sam2') order by owner.name asc,Estimated_Completion_Date__c asc];

All Answers

sai.sfsai.sf

try below code..

 

<apex:column headervalue="Case Number">
            <apex:outputlink value="/{!c.Id}"  target="_blank">
            <apex:outputtext value="{!c.CaseNumber}"/>
            </apex:outputlink>
   </apex:column>

 

 

 

if(para1=='Sam/Sam1/Sam2')
         return [select CaseNumber,Status,owner.name,subject,Estimated_Com

pletion_Date__c,Complete__c,ClosedDate from Case
                 where ClosedDate = LAST_N_DAYS:7 and (owner.name ='Sam' OR owner.name ='Sam1' OR owner.name ='Sam2') order by Estimated_Completion_Date__c asc,order by owner.name asc];

sam_Adminsam_Admin

Excellent it worked for the page but am getting error in query Compile Error: unexpected token: 'by' at line 53 column 376, any other way ?

sai.sfsai.sf

if(para1=='Sam/Sam1/Sam2')
         return [select CaseNumber,Status,owner.name,subject,Estimated_Com

pletion_Date__c,Complete__c,ClosedDate from Case
                 where ClosedDate = LAST_N_DAYS:7 and (owner.name ='Sam' OR owner.name ='Sam1' OR owner.name ='Sam2') order by owner.name asc,Estimated_Completion_Date__c asc];

This was selected as the best answer
sam_Adminsam_Admin

Excellent it did worked.

 

Thanks kiran