Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tyoshikawa1106
Created November 11, 2014 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyoshikawa1106/742c325cb7c1cdc59ce2 to your computer and use it in GitHub Desktop.
Save tyoshikawa1106/742c325cb7c1cdc59ce2 to your computer and use it in GitHub Desktop.
TaskPriorityオブジェクトの処理サンプル
<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>
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
];
}
}
@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