Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar

Taiki Yoshikawa tyoshikawa1106

View GitHub Profile
@tyoshikawa1106
tyoshikawa1106 / InputFieldComponent.component
Last active August 29, 2015 14:04
一つのコンポーネントを同時に複数使用する
<apex:component controller="InputFieldComponentController" id="component">
<apex:actionFunction name="prmClearBtn" action="{!doClear}" reRender="block" />
<apex:pageBlock id="block">
<apex:pageBlockButtons id="blockButtons">
<apex:commandButton value="CLEAR" onclick="return onClickBtn();" />
</apex:pageBlockButtons>
<apex:pageBlockSection id="section">
<apex:pageBlockSectionitem id="sectionItem">
<apex:outputLabel value="INPUT" for="inputFieldVal" />
@tyoshikawa1106
tyoshikawa1106 / YouTubeView.page
Created August 19, 2014 14:18
Gist:PrettyEmbed.jsをつかったYouTube動画の埋め込み
<apex:page showHeader="true" sidebar="false">
<apex:includeScript value="https://code.jquery.com/jquery-2.1.1.min.js" />
<apex:includeScript value="{!$Resource.PrettyEmbedJs}" />
<div id="vf-page">
<apex:form id="form">
<div id="my-video-display" ></div>
</apex:form>
</div>
@tyoshikawa1106
tyoshikawa1106 / AccountMainController.cls
Last active August 29, 2015 14:05
別クラスの内部クラスを呼び出し
public with sharing class AccountMainController {
public AccountMainController() {
List<AccountSubController.Wrapper> wrapper = new List<AccountSubController.Wrapper>();
}
}
@tyoshikawa1106
tyoshikawa1106 / SOQL
Created August 25, 2014 13:49
SOQLのLIKEと%
String key = '株式会社 セールスフォース%ドットコム';
String query = 'SELECT Name FROM Account WHERE Name LIKE ' + '\'' + String.escapeSingleQuotes(key + '%') + '\'';
System.debug(query);
List<Account> accounts = database.query(query);
for (Account a : accounts) {
System.debug(a.Name);
}
System.debug(accounts.size());
@tyoshikawa1106
tyoshikawa1106 / SOQL.cls
Last active August 29, 2015 14:05
Likeとバインド変数
String key = 'あいう%';
key = key.replace('%', '\\%');
key = key + '%';
String query = 'SELECT Name FROM Account WHERE Name LIKE: key ';
List<Account> results = database.query(query);
for (Account a : results) {
System.debug(a.Name);
}
@tyoshikawa1106
tyoshikawa1106 / SUBSTITUTE
Last active August 29, 2015 14:05
SFDC数式:半角スペースと全角スペースの置換
SUBSTITUTE(SUBSTITUTE(FullName__c, ' ', ''), ' ', '')
@tyoshikawa1106
tyoshikawa1106 / LikeSearch.page
Created August 26, 2014 14:19
SFDC:SOQLのLIKE検索で押さえておきたいポイント
<apex:page controller="LikeSearchController">
<apex:form id="form">
<apex:pageBlock >
<apex:pageBlockButtons location="bottom">
<apex:commandButton value=" Search " action="{!doSearch}" reRender="form" />
</apex:pageBlockButtons>
<apex:pageBlockSection columns="1">
<apex:inputText value="{!key}" label="{!$ObjectType.Account.Fields.Name.Label}" style="width: 200px;" />
<apex:pageBlockTable value="{!accounts}" var="item">
<apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
@tyoshikawa1106
tyoshikawa1106 / JavaScriptGetUrlParameters
Created August 27, 2014 13:51
JavaScriptでURLパラメータ取得処理
<apex:page showHeader="true" sidebar="false">
<div id="vf-page">
<h1>Congratulations</h1>
This is your new Page
</div>
<script type="text/javascript">
var prmId = '{!$CurrentPage.parameters.id}';
var prmKey = '{!$CurrentPage.parameters.key}';
console.log('id = ' + prmId);
console.log('key = ' + prmKey);
@tyoshikawa1106
tyoshikawa1106 / JSforceAnalyticsAPI.page
Created August 28, 2014 03:05
Gist - JSforceとAnalyticsAPIで最近参照したレポート情報を表示
<apex:page showHeader="true" sidebar="false" id="page">
<apex:includeScript value="//code.jquery.com/jquery-2.1.1.min.js" />
<apex:includeScript value="//cdnjs.cloudflare.com/ajax/libs/jsforce/1.2.0/jsforce.min.js" />
<div id="vf-page">
<apex:form id="form">
<h1>最近参照したレポートリスト</h1>
<ul id="reportList"></ul>
</apex:form>
</div>
@tyoshikawa1106
tyoshikawa1106 / OpportunityDateSearch.page
Created September 4, 2014 05:51
datepickerのサンプル
<apex:page controller="OpportunityDateSearchController" showHeader="true" sidebar="false" docType="html-5.0" tabStyle="Opportunity" id="page">
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" />
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" />
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/i18n/jquery.ui.datepicker-ja.js" />
<apex:styleSheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css" />
<apex:include pageName="OpportunityDateSearchCss" />
<div id="vf-page">
<apex:sectionHeader title="{!$Label.Forcedotcom}" subTitle="{!$Label.Opportunity_Search}" />