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
Craig Brumby 6Craig Brumby 6 

Retrieve record name not id in visualforce page

I am trying to retrieve a record name in my visualforce page, however it will only let me get the ID number.

I have tried putting {!Case.Name} with no luck - I get the error that the field does not exist.

<apex:page standardController="Case" renderAs="PDF" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false">
<head>
 <style> body { font-family: Arial Unicode MS; font-size:14px;}
 th {font-size:18px; padding-right:20px; font-weight:bold;}
 td{padding-right:20px;}
 span {font-weight:800;}
h3 {font-family: Arial Unicode MS; font-size:14px; font-weight:bold; text-decoration: underline; margin:0;}
.product {margin-bottom:30px; border:1px; border-style: solid;}
.img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 40%;
}
.inside {margin:20px;}
  </style>
</head>
<body>
<p class="img"><apex:image url="{!URLFOR($Resource.logo,'lf_logo.png')}" width="300px"/></p>
  
 <br></br>
Regarding your warranty case number   <apex:outputText value="{!Case.Id}"/> 
 
Best Answer chosen by Craig Brumby 6
Shubham_KumarShubham_Kumar
Hi Craig
Are you sure "Name" is a field on Case, i would advise you to check the field api.
Case usually has "CaseNumber" as the standard field.
Do let me know if you have any further query.

P.S: Mark this as the best answer if this helped

Thanks
Shubham Kumar

All Answers

Shubham_KumarShubham_Kumar
Hi Craig
Are you sure "Name" is a field on Case, i would advise you to check the field api.
Case usually has "CaseNumber" as the standard field.
Do let me know if you have any further query.

P.S: Mark this as the best answer if this helped

Thanks
Shubham Kumar
This was selected as the best answer
Craig Brumby 6Craig Brumby 6
Hi Shubham,
That was it!! Feeling just a little silly about this one now......
Shubham_KumarShubham_Kumar
Hi Craig
Glad it helped and don`t worry, that`s just how we learn.