Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar
🇯🇵
TOKYO

Taiki Yoshikawa tyoshikawa1106

🇯🇵
TOKYO
View GitHub Profile
@tyoshikawa1106
tyoshikawa1106 / getFolders.cls
Last active December 18, 2015 07:59
レポートのフォルダ取得用SOQL
public List<Folder> getFolders(Set<String> folderDeveloperNames) {
return [
select
Id
,DeveloperName
from
Folder
where
DeveloperName IN: folderDeveloperNames
and
@tyoshikawa1106
tyoshikawa1106 / getReports.cls
Created June 10, 2013 22:08
レポートフォルダIDに紐付くレポート取得用SOQL
public List<Report> getReports(Set<Id> folderIds) {
return [
select
Id
,Name
from
Report
where
OwnerId IN: folderIds
];
<apex:page standardController="Account" extensions="DynamicAccountFieldsLister">
<apex:pageMessages /><br/>
<apex:form >
<apex:pageBlock title="Edit Account" mode="edit">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.Name}"/>
<apex:repeat value="{!editableFields}" var="f">
<apex:inputField value="{!Account[f]}"/>
</apex:repeat>
</apex:pageBlockSection>
@tyoshikawa1106
tyoshikawa1106 / ActionFunctionVerificationController.cls
Last active December 18, 2015 13:09
JavaScriptの省略記法でのActionFunction動作確認
public with sharing class ActionFunctionVerificationController {
public Account account {get; set;}
public ActionFunctionVerificationController(ApexPages.StandardController stdController) {
this.account = new Account();
}
public void doClick() {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, this.account.Name));
@tyoshikawa1106
tyoshikawa1106 / Sample.js
Created June 15, 2013 10:32
JavaScriptの省略記法サンプル
if(confirm("よろしいですか?")) doClickBtn();
public class CookieController {
/*
* コンストラクタ
*/
public CookieController() {
Cookie counter = ApexPages.currentPage().getCookies().get('counter');
if (counter == null) {
@tyoshikawa1106
tyoshikawa1106 / CheckBaseController.cls
Last active December 18, 2015 15:29
クラス・継承クラス・ページアクション・Getメソッドの実行順序の確認
public virtual with sharing class CheckBaseController {
public CheckBaseController() {
System.debug('◆◆◆◆CheckBaseController:START');
System.debug('◆◆継承クラス・コンストラクタ');
System.debug('◆◆◆◆CheckBaseController:END');
}
}
@tyoshikawa1106
tyoshikawa1106 / SelectRadioController.cls
Created June 19, 2013 14:08
Apexでラジオボタン
public class SelectRadioController {
public String radio {get;set;}
public Integer result {get; set;}
public SelectRadioController() {
this.radio = '';
this.result = null;
}
public void doClick() {
@tyoshikawa1106
tyoshikawa1106 / ExcelPage.page
Created June 19, 2013 14:18
Excel出力用のページにTableタグが2つあるとwidthが聞かなくなるみたい。
<apex:page showHeader="false" sidebar="false" cache="true" contenttype="application/vnd.ms-excel; #extract.xls;" >
<head>
<style type="text/css">
.col1 {width:200px;background-color: #99cc00;}
.col2 {width:50px;background-color: #99cc00;}
.col3 {width:700px;background-color: #99cc00;}
</style>
</head>
<body>
<table border="1">
@tyoshikawa1106
tyoshikawa1106 / SystemDebugController.cls
Created June 22, 2013 02:14
System.debugについて
public class SystemDebugController {
public SystemDebugController() {
System.debug('◆◆◆◆SystemDebugController:START');
System.debug('◆◆getScriptStatements = ' + Limits.getScriptStatements());
System.debug('◆◆getCpuTime = ' + Limits.getCpuTime());
System.debug('◆◆◆◆SystemDebugController:END');
}