You need to sign in to do that
Don't have an account?
KellyKanches
(Beginner Developer building VF Page) Need Code to reference custom object field
Hi all,
I am a beginner developer (really an admin but learning to build VF pages)
I built a page for the Account Object that I now need to move to a Custom Object and reference the Custom Object (School__C) fields.
I cloned the Account page I built and changed out the Account wth School...I must be doing something wrong because I get the error
"School Does Not Exist"
Can someone help?
Code below
<apex:page tabStyle="School__c" standardController="School">
<style >
p {
font-size:16px;
}
.beenWorkingOut {
font-size:16px;
}
.paraCrunch {
margin-left:10%;
margin-right:10%;
}
a {
text-decoration:none;
}
</style>
<apex:pageBlock title="MealViewer Initial Call to Customer Checklist">
<apex:pageBlockSection title="Summary" columns="2">
<apex:outputField value="{!School.Phone}"/>
<apex:outputField value="{!School.Name}"/>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
<apex:outputLink onClick="window.open('/{!school.id}')">(View School)</apex:outputLink>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:form >
<span style="float:right">
<apex:commandButton action="{!save}" value="Save" />
<apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span>
<br /><br /><br />
<span style="float:right; font-size:12px; color:grey;">version 1.0 - revised 2015.04.07</span>
<apex:pageBlock title="Details">
<apex:pageBlockSection title="Introduction" columns="2">
<p class="paraCrunch">
My name is <b>{!$User.FirstName} {!$User.LastName}</b> and I'm going to be taking care of you as your Onboarding Specialist here at MealViewer! Do you have a few minutes?
</p>
<p class="paraCrunch">
<ul class="beenWorkingOut">
<li>Call Summary</li>
<ul>
<li><a id="one1" href="#" style="color:black;" onclick="setColorById('one1','green');return false;">Ask the Questions</a></li>
<li><a id="one2" href="#" style="color:black;" onclick="setColorById('one2','green');return false;">Complete the Form</a></li>
<li><a id="one3" href="#" style="color:black;" onclick="setColorById('one3','green');return false;">Thank the Customer</a></li>
</ul>
</ul>
</p>
</apex:pageBlockSection>
<apex:pageBlockSection title="School Details" columns="2">
<p class="paraCrunch">
<ul class="beenWorkingOut">
<li><a id="two1" href="#" style="color:black;" onclick="setColorById('two1','green');return false;">Review All Account Details</a></li>
<li><a id="two2" href="#" style="color:black;" onclick="setColorById('two2','green');return false;">Verify Current Listed Contacts</a></li>
</ul>
</p>
<apex:pageBlockSectionItem />
<apex:inputField value="{!school.How_Many_Total_Wired_Players__c}"/>
<apex:inputField value="{!school.How_Many_Total_Wireless_Players__c}"/>
<apex:inputField value="{!school.How_Many_Total_Displays__c}"/>
<apex:inputField value="{!school.How_Many_Additional_Digital_Suites__c}"/>
<apex:inputField value="{!school.How_Many_Total_Mounts__c}"/>
<apex:inputField value="{!school.How_Many_Total_Splitters__c}"/>
<apex:inputField value="{!school.Length_between_Displays_for_splitters__c}"/>
<apex:inputField value="{!school.Location_of_Player_in_School__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Menu_Planning_Software_Currently_Used__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Do_They_Have_Different_Serving_Lines__c}"/>
<apex:inputField value="{!school.Serving_Lines_per_Player__c}"/>
<apex:inputField value="{!school.Serving_Line_Name_s__c}"/>
<apex:inputField value="{!school.Cycle__c}"/>
<apex:inputField value="{!school.Cycle_Week__c}"/>
<apex:inputField value="{!school.Customer_Confirmed_Installation_Date__c}"/>
<apex:inputField value="{!school.Desired_Launch_Date__c}"/>
<apex:inputField value="{!school.Installation_Date_Time__c}"/>
<apex:inputField value="{!school.Installation_Area_Type__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Display_Size__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Contact Information" columns="1">
<p class="paraCrunch">
<ul class="beenWorkingOut">
<apex:inputField value="{!school.Maintenance_Contact__c}"/>
<apex:inputField value="{!school.IT_Contact__c}"/>
</ul>
</p>
</apex:pageBlockSection>
<apex:pageBlockSection title="Wrap-Up" columns="1">
<p class="paraCrunch">
Thank you so much for taking the time to meet with me today. We are so excited to get started and look forward to working with you. Are there any questions about the program that you have for me at this time?
</p>
<p class="paraCrunch">
Again, my name is <b>{!$User.FirstName}</b>, and if you have any questions, please contact me at <b>803-380-5538</b>. Or, you can email me at <b>{!$User.Email}</b>.
</p>
</apex:pageBlockSection>
</apex:pageBlock>
<span style="float:right">
<apex:commandButton action="{!save}" value="Save" />
<apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span><br /><br />
</apex:form>
<br />
<script type="text/javascript">
function confirmCancel() {
return confirm('Are you sure you want to cancel? All changes will be lost!');
}
function addressCopy(b0, b1, b2, b3, s0, s1, s2, s3) {
// Copy billing fields to shipping fields
document.getElementById(s0).value = document.getElementById(b0).value;
document.getElementById(s1).value = document.getElementById(b1).value;
document.getElementById(s2).value = document.getElementById(b2).value;
document.getElementById(s3).value = document.getElementById(b3).value;
// No form submission
return false;
}
function setColorById(id,sColor) {
var elem;
if (document.getElementById) {
if (elem=document.getElementById(id)) {
if (elem.style) {
elem.style.color=sColor;
return 1; // success
}
}
}
return 0; // failure
}
</script>
</apex:page>
I am a beginner developer (really an admin but learning to build VF pages)
I built a page for the Account Object that I now need to move to a Custom Object and reference the Custom Object (School__C) fields.
I cloned the Account page I built and changed out the Account wth School...I must be doing something wrong because I get the error
"School Does Not Exist"
Can someone help?
Code below
<apex:page tabStyle="School__c" standardController="School">
<style >
p {
font-size:16px;
}
.beenWorkingOut {
font-size:16px;
}
.paraCrunch {
margin-left:10%;
margin-right:10%;
}
a {
text-decoration:none;
}
</style>
<apex:pageBlock title="MealViewer Initial Call to Customer Checklist">
<apex:pageBlockSection title="Summary" columns="2">
<apex:outputField value="{!School.Phone}"/>
<apex:outputField value="{!School.Name}"/>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
<apex:outputLink onClick="window.open('/{!school.id}')">(View School)</apex:outputLink>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:form >
<span style="float:right">
<apex:commandButton action="{!save}" value="Save" />
<apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span>
<br /><br /><br />
<span style="float:right; font-size:12px; color:grey;">version 1.0 - revised 2015.04.07</span>
<apex:pageBlock title="Details">
<apex:pageBlockSection title="Introduction" columns="2">
<p class="paraCrunch">
My name is <b>{!$User.FirstName} {!$User.LastName}</b> and I'm going to be taking care of you as your Onboarding Specialist here at MealViewer! Do you have a few minutes?
</p>
<p class="paraCrunch">
<ul class="beenWorkingOut">
<li>Call Summary</li>
<ul>
<li><a id="one1" href="#" style="color:black;" onclick="setColorById('one1','green');return false;">Ask the Questions</a></li>
<li><a id="one2" href="#" style="color:black;" onclick="setColorById('one2','green');return false;">Complete the Form</a></li>
<li><a id="one3" href="#" style="color:black;" onclick="setColorById('one3','green');return false;">Thank the Customer</a></li>
</ul>
</ul>
</p>
</apex:pageBlockSection>
<apex:pageBlockSection title="School Details" columns="2">
<p class="paraCrunch">
<ul class="beenWorkingOut">
<li><a id="two1" href="#" style="color:black;" onclick="setColorById('two1','green');return false;">Review All Account Details</a></li>
<li><a id="two2" href="#" style="color:black;" onclick="setColorById('two2','green');return false;">Verify Current Listed Contacts</a></li>
</ul>
</p>
<apex:pageBlockSectionItem />
<apex:inputField value="{!school.How_Many_Total_Wired_Players__c}"/>
<apex:inputField value="{!school.How_Many_Total_Wireless_Players__c}"/>
<apex:inputField value="{!school.How_Many_Total_Displays__c}"/>
<apex:inputField value="{!school.How_Many_Additional_Digital_Suites__c}"/>
<apex:inputField value="{!school.How_Many_Total_Mounts__c}"/>
<apex:inputField value="{!school.How_Many_Total_Splitters__c}"/>
<apex:inputField value="{!school.Length_between_Displays_for_splitters__c}"/>
<apex:inputField value="{!school.Location_of_Player_in_School__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Menu_Planning_Software_Currently_Used__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Do_They_Have_Different_Serving_Lines__c}"/>
<apex:inputField value="{!school.Serving_Lines_per_Player__c}"/>
<apex:inputField value="{!school.Serving_Line_Name_s__c}"/>
<apex:inputField value="{!school.Cycle__c}"/>
<apex:inputField value="{!school.Cycle_Week__c}"/>
<apex:inputField value="{!school.Customer_Confirmed_Installation_Date__c}"/>
<apex:inputField value="{!school.Desired_Launch_Date__c}"/>
<apex:inputField value="{!school.Installation_Date_Time__c}"/>
<apex:inputField value="{!school.Installation_Area_Type__c}"/>
<apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
<apex:inputField value="{!school.Display_Size__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Contact Information" columns="1">
<p class="paraCrunch">
<ul class="beenWorkingOut">
<apex:inputField value="{!school.Maintenance_Contact__c}"/>
<apex:inputField value="{!school.IT_Contact__c}"/>
</ul>
</p>
</apex:pageBlockSection>
<apex:pageBlockSection title="Wrap-Up" columns="1">
<p class="paraCrunch">
Thank you so much for taking the time to meet with me today. We are so excited to get started and look forward to working with you. Are there any questions about the program that you have for me at this time?
</p>
<p class="paraCrunch">
Again, my name is <b>{!$User.FirstName}</b>, and if you have any questions, please contact me at <b>803-380-5538</b>. Or, you can email me at <b>{!$User.Email}</b>.
</p>
</apex:pageBlockSection>
</apex:pageBlock>
<span style="float:right">
<apex:commandButton action="{!save}" value="Save" />
<apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span><br /><br />
</apex:form>
<br />
<script type="text/javascript">
function confirmCancel() {
return confirm('Are you sure you want to cancel? All changes will be lost!');
}
function addressCopy(b0, b1, b2, b3, s0, s1, s2, s3) {
// Copy billing fields to shipping fields
document.getElementById(s0).value = document.getElementById(b0).value;
document.getElementById(s1).value = document.getElementById(b1).value;
document.getElementById(s2).value = document.getElementById(b2).value;
document.getElementById(s3).value = document.getElementById(b3).value;
// No form submission
return false;
}
function setColorById(id,sColor) {
var elem;
if (document.getElementById) {
if (elem=document.getElementById(id)) {
if (elem.style) {
elem.style.color=sColor;
return 1; // success
}
}
}
return 0; // failure
}
</script>
</apex:page>
All Answers
Now I am getting this error
Error: Digital_Suite_Checklist line 153, column 3: The element type "apex:page:" must be terminated by the matching end-tag "</apex:page:>"
Error: The element type "apex:page:" must be terminated by the matching end-tag "</apex:page:>"
Do you know how to fix? I am so thankful for your help!