function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KbhaskarKbhaskar 

case redirects the user

Hi ,the below code shows case's with subject but when i click on the subject of the case  the page directs the user to the detail page of the respective case record. but thats not happening below .does anyone knows about it ?
apex Class
public with sharing class NewCaseListController {
    public List<Case> getNewCases() {
        List<Case> results = Database.query(
            'SELECT Id,Subject, CaseNumber, Origin, Status, Account.Name ' +
            'FROM Case ' +
            'LIMIT 100'
    );
    return results;
}

}
apex page 1
<apex:page controller="NewCaseListController">
  <apex:repeat value="{!NewCases}" var="Case">

<apex:outputLink onclick="/apex/detailtag?id={!Case.Id}">
 <li> {!Case.subject}</li>
   
  </apex:outputLink>
  </apex:repeat>
  
</apex:page>
page 2(detail tag)
apex/detailtag
<apex:page standardController="case">
   <apex:detail subject="{!case.userdetail}" relatedList="false" title="false"/> 
</apex:page>




 
Best Answer chosen by Kbhaskar
RAM AnisettiRAM Anisetti
Hi,
modify ur code like this.....

 
<apex:page controller="NewCaseListController">
 <apex:repeat value="{!NewCases}" var="Case">

<apex:outputLink value="/apex/detailtag?id={!Case.Id}">
 <li> {!Case.subject}</li>
   
  </apex:outputLink>
  </apex:repeat>
  
</apex:page>