- Only alphanumeric characters (Letters, numbers and underscore) are allowed
- Must begin with a letter
- Can’t end with an underscore
- Can’t contain two consecutive underscore characters.
- Must be unique across all city fields
- Can not be "ABC", because there is one field named "ABC" in City. I defined this field, to explain this point.
- Can not be the name of a different relationship… Although it may not be technically accurate, it helps if you think these relationships create a field in the destination object (City in this case).
- Origin_Flights
- Destination_Flights
<apex:relatedList list="Origin_Flights__r" /> <apex:relatedList list="Destination_Flights__r" />Simulating a standard page layout in VisualForce My next step, create a page that looked as closed as possible to the ones using standard page layouts. Basically, this was my goal: As you can see, there are a lot of standard related lists. How could I get their names? Eclipse will tell you: With that information, I created a page that looked as close to the standard page layout as I could. Before I show you the results, let me tell you there are some differences, but I will leave them for a future post. For example, I did not created the JavaScript to show the related lists Divs on mouse over. The section header is not identical (some links are missing) This is what I got: Finally, here is the code...
VisualForce Page:
<apex:page standardController="City__c" showHeader="true" tabStyle="City__c"> <apex:sectionHeader title="City" subtitle="{!City__c.Name}" help="/help/doc/user_ed.jsp?loc=help&target=getstart_help.htm§ion=Getting_Started" /> This page is made in visualFroce simulating a Page Layout Page... This is the description... blah... blah... blah<br/><br/> <apex:detail relatedList="false" title="false" /> <apex:relatedList list="OpenActivities"/> <apex:relatedList list="ActivityHistories"/> <apex:relatedList list="NotesAndAttachments"/> <apex:relatedList list="Origin_Flights__r" /> <apex:relatedList list="Destination_Flights__r" /> <apex:relatedList list="ProcessSteps"/> <H1>Other Related Lists Available from VisualForce</H1> <apex:pageblock title="City History"> <apex:pageBlockTable value="{!City__c.Histories}" var="h"> <!-- h.ID, h.ParentId --> <apex:column headerValue="Date"> <apex:outputField value="{!h.CreatedDate}"/> </apex:column> <apex:column headerValue="User"> <apex:outputField value="{!h.CreatedById}"/> </apex:column> <apex:column headerValue="Field"> <apex:outputText value="{!h.Field}"/> <!-- This is a picklist --> </apex:column> <apex:column headerValue="From"> <apex:outputField value="{!h.OldValue}"/> </apex:column> <apex:column headerValue="To"> <apex:outputField value="{!h.NewValue}"/> </apex:column> <apex:column headerValue="IsDeleted"> <apex:outputField value="{!h.IsDeleted}"/> </apex:column> </apex:pageBlockTable> </apex:pageblock> <apex:pageblock title="City Tags"> <apex:pageBlockTable value="{!City__c.Tags}" var="t"> <!-- t.Id, t.ItemId--> <apex:column headerValue="TagDefinitionId"> <apex:outputField value="{!t.TagDefinitionId}"/> </apex:column> <apex:column headerValue="CreatedDate"> <apex:outputField value="{!t.CreatedDate}"/> </apex:column> <apex:column headerValue="SystemModstamp"> <apex:outputField value="{!t.SystemModstamp}"/> </apex:column> <apex:column headerValue="IsDeleted"> <apex:outputField value="{!t.IsDeleted}"/> </apex:column> <apex:column headerValue="Name"> <apex:outputField value="{!t.Name}"/> </apex:column> <apex:column headerValue="Type"> <apex:outputField value="{!t.Type}"/> </apex:column> </apex:pageBlockTable> </apex:pageblock> </apex:page>
No comments:
Post a Comment