You need to sign in to do that
Don't have an account?

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}"/>
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}"/>
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
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
That was it!! Feeling just a little silly about this one now......
Glad it helped and don`t worry, that`s just how we learn.