Created
November 11, 2014 19:19
-
-
Save tyoshikawa1106/742c325cb7c1cdc59ce2 to your computer and use it in GitHub Desktop.
TaskPriorityオブジェクトの処理サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page controller="TaskPriorityViewController" showHeader="true" sidebar="false" id="page"> | |
<div id="vf-page"> | |
<apex:form id="form"> | |
<apex:pageBlock title="{!$ObjectType.TaskPriority.Label}"> | |
<apex:pageBlockTable value="{!taskPriorities}" var="item"> | |
<apex:column headerValue="{!$ObjectType.TaskPriority.Fields.Id.Label}"> | |
<apex:outputField value="{!item.Id}" /> | |
</apex:column> | |
<apex:column headerValue="{!$ObjectType.TaskPriority.Fields.MasterLabel.Label}"> | |
<apex:outputField value="{!item.MasterLabel}" /> | |
</apex:column> | |
<apex:column headerValue="{!$ObjectType.TaskPriority.Fields.IsDefault.Label}"> | |
<apex:outputField value="{!item.IsDefault}" /> | |
</apex:column> | |
<apex:column headerValue="{!$ObjectType.TaskPriority.Fields.IsHighPriority.Label}"> | |
<apex:outputField value="{!item.IsHighPriority}" /> | |
</apex:column> | |
<apex:column headerValue="{!$ObjectType.TaskPriority.Fields.SortOrder.Label}"> | |
<apex:outputField value="{!item.SortOrder}" /> | |
</apex:column> | |
</apex:pageBlockTable> | |
</apex:pageBlock> | |
</apex:form> | |
</div> | |
</apex:page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class TaskPriorityViewController { | |
public List<TaskPriority> taskPriorities {get; set;} | |
public TaskPriorityViewController() { | |
this.taskPriorities = [ | |
SELECT | |
Id | |
,MasterLabel | |
,IsDefault | |
,IsHighPriority | |
,SortOrder | |
FROM | |
TaskPriority | |
ORDER BY SortOrder ASC | |
]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
private class TaskPriorityViewControllerTest { | |
static testMethod void TaskPriorityViewControllerTest() { | |
Test.startTest(); | |
TaskPriorityViewController cls = new TaskPriorityViewController(); | |
System.assertEquals(cls.taskPriorities.isEmpty(), false); | |
Test.stopTest(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment